Started by
AlLeGameur
on
Topic category: Help with Minecraft modding (Java Edition)
Hello everyone!
I've been trying to create an item that when right clicked freezes time around you (including mobs). How can I do it?
This has been asked before on this forum, but I tried using a procedure given in a post from last year ( https://imgur.com/a/vfKgwKo ) and it just crashes my game.
Could anyone help me?
I still need help with this.
Still need help with modding this in...
Hello! You'll probably need to work quite a bit on this, but a good place to start is a procedure that runs "On loaded entity tick update".
You will also need a global logic variable. When you right click the time freezing item, the variable gets toggled between true and false.
Inside the procedure you just created, if the time stop variable is set to true and the entity isn't a player or server player, use "attempt to override motion vector 0 0 0" to freeze the entities in place, attempt to stop navigation, set the rotation to 0 0, set no-gravity to true.
You can also modify some gamerules, like setting random tick speed to 0, daylight/weather cycle to false, no fire spreading, no patrols etc.
You will of course need to reverse all of these once the variable is set back to false.
Hope this helps!
is help still needed, i made a mod that doing just this
I'd be interested in what you did, Blue apple
The 1.20 update came with a nifty new command, /tick.
Use the Execute command block and set it to "tick freeze" when you want time to pause and the same block again with "tick unfreeze" when you want time to resume.
By default, every entity but players should be frozen
The only downside to this is that tick based procedures wont work, and it freezes everything, including item entities and particles.