1

I run this command in Minecraft Bedrock Edition Version 1.19.51 in a command block:

execute @p ~ ~ ~ tp @e[type=fishing_hook] ^ ^ ^3

The command block reports following error:

Syntax error: Unexpected "@p": at "execute >>@p<<

I don't know what is the problem with the command, since the command is from a Minecraft command book.

1
  • 1
    Syntax for commands can change, which is likely what happened here. The Minecraft Wiki has more up to date information.
    – MBraedley
    Dec 17, 2022 at 13:24

1 Answer 1

3

The /execute command has had its syntax changed to resemble that of Java Edition. The new syntax used to be opt-in, but is now standard for all users. Any /execute commands using the old syntax need to be updated to the new syntax to function.

Your command can be written using the new syntax as follows:

execute at @p run tp @e[type=fishing_hook] ^ ^ ^3

Learn more about the changes to /execute on this article.

2
  • "The /execute command has had its syntax changed to match that of Java Edition." According the docs, the new syntax does not have full parity with Java, as it does not yet support storing the output of commands or using conditions based on the rotation of entities, among other things.
    – slink
    Dec 23, 2022 at 0:34
  • @slink Fully aware of this; Updated a word from "match" to "resemble" for better accuracy. Dec 23, 2022 at 1:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .