The bug
Using the new 'function' feature of the 1.12 pre-releases, if you have a relative teleporting command continuously running via gameLoopFunction it can produce different results in Creative mode than it does in Survival or Adventure mode.
Having the function be called by a repeating command block works correctly.
How to reproduce
- Download the attached function swing.mcfunction and place it in the following directory of your world folder
data/functions/custom
- Open the world
- Stand on a block higher than the blocks around you
- Use the following commands
/scoreboard objectives add swing dummy /scoreboard players set @s swing 0 /setblock ~10 ~-1 ~ sandstone /summon armor_stand ~5 ~3 ~ {NoGravity:1b,CustomName:"2"}
- Set the function as gameLoopFunction
/gamerule gameLoopFunction custom:swing
- Switch to Survival mode
/gamemode survival
- Cast a fishing rod and try to hit the armor stand
→ You are teleported in a straight line - Reset the gameLoopFunction
/gamerule gameLoopFunction -
- Place a repeating command block with the following command and active it
function custom:swing
- Repeat steps 6 and 7
→ You properly "swing" now