I made a command that gives me gamemode creative when I'm at level 63 of the world:
/execute as @a at @a if entity @a positioned ~ 63 ~ run gamemode creative @a
This is wrong and i dont know why but it gives me gamemode 1 also when im not in lv 63. Pls help!
/execute as @a at @a if entity @a positioned ~ 63 ~ run gamemode creative @a
This is wrong and i dont know why but it gives me gamemode 1 also when im not in lv 63. Pls help!
2
/execute as @a at @a if entity @a[y=63,distance=..0] run gamemode creative @a
Basically, this is using the selector argument y and distance. Distance=0 makes sure the player is exactly 63 on the Y axis. Using positioned doesn't allow for this. Hope this helped!
Basically, this is using the selector argument y and distance. Distance=0 makes sure the player is exactly 63 on the Y axis. Using positioned doesn't allow for this. Hope this helped!
This won't work. You are executing as every player in the world, executing at every player in the world, checking if there is one player at y=63, and if true, setting everyone's gamemode to creative. Why is this a problem? If multiple players are online and one player goes to y=63, your command will set everyone to creative.
To avoid this, it's best to run as @a once, and use @s for the rest of the command to execute as itself.
~SUPERIONtheKnight
To avoid this, it's best to run as @a once, and use @s for the rest of the command to execute as itself.
/execute as @a at @s run gamemode creative @s[y=63,dx=0]~SUPERIONtheKnight
