Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-121875

Can't move player position using /execute store result

    • Icon: Bug Bug
    • Resolution: Duplicate
    • None
    • Minecraft 17w45b
    • None
    • Windows 10, bundled java runtime
    • Unconfirmed

      The command "/execute store result" can be used to update a mob's position, but not that of a player.

      After running the commands:

      /scoreboard objectives add storedY dummy
      /execute store result score @s storedY run data get entity @s Pos[1] 1.1
      

      The following command does work:

      /execute store result entity @e[type=creeper,limit=1,sort=nearest] Pos[1] double 1 run scoreboard players get @s storedY
      

      But the following command does not:

      /execute store result entity @s Pos[1] double 1 run scoreboard players get @s storedY
      

          [MC-121875] Can't move player position using /execute store result

          I'll do that. Thanks for the help.

          Richard A. Hallett added a comment - I'll do that. Thanks for the help.

          If the entity is moved in the function it is running, it can still be targeted.
          So have a function file that the entity runs, that moves the entity, that teleports the player to the entity and that removes the entity.

          user-f2760 (Inactive) added a comment - If the entity is moved in the function it is running, it can still be targeted. So have a function file that the entity runs, that moves the entity, that teleports the player to the entity and that removes the entity.

          I'll have to try that. I had assumed that moving an entity to an unloaded chunk would mean it would instantly unload, so commands not work on it.

          Richard A. Hallett added a comment - I'll have to try that. I had assumed that moving an entity to an unloaded chunk would mean it would instantly unload, so commands not work on it.

          user-f2760 (Inactive) added a comment - - edited

          You can spawn in an entity, run a function on it, make it move to the desired location, make the player teleport to it (execute at @s run teleport player @s) and then kill the entity.

          user-f2760 (Inactive) added a comment - - edited You can spawn in an entity, run a function on it, make it move to the desired location, make the player teleport to it (execute at @s run teleport player @s) and then kill the entity.

          Richard A. Hallett added a comment - - edited

          Ah, that's a shame. I was hoping to use this in a data pack to teleport a player to somewhere a vast distance away, then later back to where they were. Chunk loading would mean that teleporting to an entity would be unlikely to work, and the teleport command doesn't accept scoreboard data as inputs. Position seems like perhaps the one thing that could be safe to be editable, given that the teleport command exists.

          Richard A. Hallett added a comment - - edited Ah, that's a shame. I was hoping to use this in a data pack to teleport a player to somewhere a vast distance away, then later back to where they were. Chunk loading would mean that teleporting to an entity would be unlikely to work, and the teleport command doesn't accept scoreboard data as inputs. Position seems like perhaps the one thing that could be safe to be editable, given that the teleport command exists.

          Player data is not editable, never has been.

          user-f2760 (Inactive) added a comment - Player data is not editable, never has been.

            Unassigned Unassigned
            RichardAHallett Richard A. Hallett
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: