I have a large command block creations world, and I've been lately trying to change the commands to the 1.13 command format. The very first project I tried to create did not work. I tried to change the command in multiple ways, and tested it in the chat. For some reason, the repeating command block did not work. The command did work in chat. Here is the command:
/execute at @e[type=slime,distance=..5] run execute at @e[distance=..2] run tp @s ~ ~5 ~
The command is meant to make the slime teleport any entity in a radius of 2 blocks 5 blocks up. Is there any problem? The command only didn't work in the always active unconditional repeating command block. When I ran it in chat it worked just fine. According to what I have seen, the command block simply does not work. I am 99% sure this is a bug.
Comments 3
Try replacing
[...] at @e[type=slime,distance=..5] [...]
with
[...] as @e[type=slime,distance=..5] at @s [...]
Friend, I managed to do it with these two ways (I changed the entity to a zombie):
/execute at @e[type=zombie] as @e[type=!zombie,distance=..5] at @s run tp ~ ~5 ~
Here, any entity that is NOT a zombie (player or item) and is within a radius of 5 blocks of any zombie will be teleported.
/execute at @e[type=!zombie] if entity @e[type=zombie,distance=..5] as @e[type=!zombie,distance=..5] run tp ~ ~5 ~
And here, if there is a zombie in a radius of 5 blocks of any entity that is NOT a zombie, it will also be teleported. Both examples work perfectly, only that the first one is more simplified.
I hope it helps you, luck!
{{@s}} means "the entity running the command." From chat, that entity is you. From a command block, the command block is running the command. Since it's not an entity, and you never changed the executor using {{as}}, {{@s}} finds nothing.