mojira.dev
MC-108965

Commands that don't need a target don't work in execute

Commands like:
/execute @p ~ ~ ~ tp ~ ~1 ~
don't work correctly (teleporting the nearest player one block up), but instead give out two error messages:
Player 'commands.generic.player.unspecified' cannot be found
and
`Failed to execute 'tp ~ ~1 ~' as <Player name>
where <Player name> is the @p player.
There are three bugs here, but if one gets fixed, the others become irrelevant:

  • The command doesn't work like it would if it got executed from the player (which execute should simulate).

  • The player name doesn't get put into the first error message. If the target selection for example meets an item, it gets displayed the same way as in the /kill feedback, but not for the player.

  • There are two error messages for one error.

If the first one gets fixed, the other two get irrelevant.

Other examples are:

  • /execute @p ~ ~ ~ scoreboard teams join test

  • /execute @p ~ ~ ~ achievement give achievement.openInventory

  • /execute @p ~ ~ ~ clear

  • /execute @p ~ ~ ~ gamemode 1

  • /execute @p ~ ~ ~ kill

  • /execute @p ~ ~ ~ setworldspawn

  • /execute @p ~ ~ ~ spawnpoint

  • /execute @p ~ ~ ~ xp 1

Special cases:

  • /execute @e ~ ~ ~ help shows the help to the player who executed the /execute command once per entity, not to the selected entity itself.

  • /execute @e ~ ~ ~ seed shows the seed to the player who executed the /execute command once per entity, not the one selected entity itself.

  • /execute @p ~ ~ ~ msg @p test shows _<Player name> whispers to you: test_ and _You whisper to <Player name>: test_.
    /msg @p test shows the error message Player 'commands.message.sameTarget' cannot be found. The same error message appears for every other entity with its UUID as player description.

  • execute @p ~ ~ ~ publish works correctly.

Linked issues

Comments 1

FaRo1

(Unassigned)

Confirmed

Minecraft 1.10.2, Minecraft 16w42a

Retrieved