• 2,327 views, 2 today
    • 236 downloads, 0 today
    • 15
    • 13
    • 3
    Razzller's Avatar Razzller
    Level 12 : Journeyman Explorer
    12
    My first datapack, that make path block more useful. Players and some mobs speed up when walking on it
    CompatibilityMinecraft 1.16
    toMinecraft 1.19
    Tags

    Create an account or sign in to comment.

    2
    11/08/2022 10:44 am
    Level 39 : Artisan Miner
    Lordphenex
    Lordphenex's Avatar
    The idea of your datapack is great !
    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 !
    3
    11/11/2022 12:18 pmhistory
    Level 4 : Apprentice Dragon
    StormDragon_64
    StormDragon_64's Avatar
    My datapack that does something similar to this and uses a tag. I haven't updated it in a while though and now I just use a mod because it seems to cause less lag. I don't think I did the loop every 5 ticks part though. Maybe you can make your own version of this, since you seem to know what your doing?
    2
    11/13/2022 3:34 pm
    Level 39 : Artisan Miner
    Lordphenex
    Lordphenex's Avatar
    Yes mods are usually more efficient than datapack because they directly use java coding and not minecraft coding. That is, poorly implemented mods can be worse than well implemented datapack.
    My comment was more meant like an advice for getting better at datapacks in general and understanding execute command.
    Planet Minecraft

    Website

    © 2010 - 2024
    www.planetminecraft.com

    Welcome