Published Nov 8th, 2022, 11/8/22 3:27 am
- 2,327 views, 2 today
- 236 downloads, 0 today
12
My first datapack, that make path block more useful. Players and some mobs speed up when walking on it
Compatibility | Minecraft 1.16 |
to | Minecraft 1.19 |
Tags |
tools/tracking
5763828
119
useful-paths
Create an account or sign in to comment.
However, there are some things that can be improved :
When using execute command, the order in wich you put the arguments can make a real difference on efficiency. The way you did it, if you have 5 cats, the effect command will be ran as all cats based on all cat positions so it will be ran 25 times.
What you can do is to invert the at and as arguments and use as @s in the at argument. This way, the effect command is ran only 5 times.
Also, you can group all the entities that should get the path effect in an entity tag, so you will only perform one entity search in your tick function.
As the entities have effects for one second, you can make a time loop slower than the tick loop, maybe a 5 ticks loop is fast enough so it all goes smoothly.
For the player part, I don't recommend to modify the base speed attribute but rather to add a modifier. It will ensure compatibility across datapacks.
I hope this will help you ! If you have any questions, feel free to ask them !
My comment was more meant like an advice for getting better at datapacks in general and understanding execute command.