-
Bug
-
Resolution: Fixed
-
Minecraft 17w48a, Minecraft 17w50a
-
Confirmed
The bug
When using the /teleport command in functions you would expect that you can leave out the @s selector as "targets" value and there was no difference in functionality. But this is not true.
When using @s the command is executed based on the position where the entity, the function was run for, was when the execution of the function started (expected), however when leaving it out the current position is used.
Note: It appears this bug only affects functions. Using /execute in chat or in a command block does not appear to cause this bug.
How to reproduce
- Download the attached datapack MC-122894 datapack.zip and place it in the datapacks folder of your world
- Open the world
- Throw an item on the ground, move away and use the following command
/execute as @e[type=item] at @s run function custom:teleport_selector
→ The item is teleported up at its original position, as expected
- Throw an item on the ground, move away and use the following command
/execute as @e[type=item] at @s run function custom:teleport_no_selector
→ The item is teleported up at your position