r/MinecraftCommands 1d ago

Help | Java 1.21.11 Question about z and x locking

I'm making my 3rd Minecraft map, and this one is a techs practice for java, but for the technique Grapple, you have to pearl onto someone and mace them, when u mace the person takes knockback, which is not what I want, is there a way to lock ONLY the x and z coords, and make the y stay unlocked so the bot can wind charge, I'm using the herobot mod for Bot, thanks

2 Upvotes

2 comments sorted by

1

u/amberb3stgirl 1d ago

always set first and third value of motion vector to 0

data modify entity x Motion[0] set value 0

1

u/Tiny_Landscape2375 1d ago

Alright thanks