Arqade Asked on August 22, 2021
I’m working on a one command creation called Magical Weapons. There’s a weapon called the Reverse Crystal, and it basically reverses the movement. If you move +1 on the x-axis, you are teleported -2 on the x-axis, and so on and so forth. But how do I test for when a player moves, like +1 X or -1 Z?
I redid the command blocks and got a much better, but still not excellent solution:
Now, what the command blocks have:
1:
/testfor @e[type=ArmorStand]
2:
/execute @a ~ ~ ~ testfor @e[type=ArmorStand,r=0]
3:
/execute @a ~ ~ ~ summon ArmorStand ~ ~ ~
4:
/kill @e[type=ArmorStand]
5:
/tp @a @e[type=ArmorStand]
Notes:
Answered by user143228 on August 22, 2021
I made a movement detection system a while ago that I think could be useful for this. You can use it as a reference or modify it to fit your creation.
You will need 1 repeating command block and 15 chain command blocks connected to it (all set to always active). Here are the commands: https://pastebin.com/445LRfFz
And here is the system in action:
it stores the player's current position into some scoreboard objectives (x and z). Then, it constantly compares the player's x objective to the player's prev_x objective to see if there are any changes. If x is greater than prev_x, that means the player has moved towards positive x. I also made it so it tags the player with "x+" and then says "x+" in chat.
Answered by MegaCrafter10 on August 22, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP