Started by
AppleMod
on
Topic category: Help with Minecraft modding (Java Edition)
I know the problem with my procedure but can't think of a way to bypass it.
I'm trying to make boots that give you speed 1, but when you drink a speed potion, it stacks so you would then have speed 1 + whatever level the potion is.
My code:
-Wait 1 ticks then on server side
do - Add potion with level -Get potion level/amplifier from event/target entity of potion SPEED + 1 for 1 ticks ambient false particles false to event/target entity type SPEED
The Problem: It's giving you speed 1, then since you have speed 1 it adds a level, to speed 2, then to 3, then to 4, then for some reason it just loops between 3 and 4
Any ideas?
There's a command in vanilla minecraft which changes base speed
/attribute @s minecraft:generic.movement_speed base set 0.2
NOTE: For when you take off the armor, to make your entity speed back to normal, execute the following command in your procedure:
/attribute @s minecraft:generic.movement_speed base set 0.10000000149011612
(the long number is what minecraft gave me as an answer when I got the base speed)
You should try it out with speed potions too, because I think they still stack, but not that much.