1

Help wrong command

Suspiria's Avatar Suspiria12/2/18 7:05 am
1 emeralds 152 2
12/2/2018 2:20 pm
SUPERIONtheKnight's Avatar SUPERIONtheKnight
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!
Posted by Suspiria's Avatar
Suspiria
Level 42 : Master Engineer
8

Create an account or sign in to comment.

2

1
12/02/2018 1:25 pm
Level 21 : Expert Engineer
Thonck
Thonck's Avatar
/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!
1
12/02/2018 2:20 pm
Level 29 : Expert Engineer
SUPERIONtheKnight
SUPERIONtheKnight's Avatar
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.
/execute as @a at @s run gamemode creative @s[y=63,dx=0]
~SUPERIONtheKnight
Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome