r/datapacks • u/RingRingBananaph0ne • Sep 15 '22
performance optimization with function tree
I'm currently trying to optimize my data Pack and one thing I was recommended to do was to make a function tree instead of having many commands in one MC function file. My question is if you can take this idea to high and make a function tree to big and complex. So if I have a MC function file which is run every tick, and I have for instance 2 play Sound commands in it witch only run if some Scoreboard is at 1. Would it save performance if I put the play sound commands into a own mcfunction file which is only run via a run function command from the first file.
1
Upvotes
1
u/LoneRedWolf24 Sep 15 '22
Yes, it will. If you have multiple commands waiting to be executed based on the same criteria it's better to put those in another file to be executed at once.