Can somebody help me with the execute commands in Minecraft?

Recently, Minecraft had removed the /testfor command, which broke these sets of commands that I was trying to execute today.

/testfor @p[r=10] {SelectedItem:{id:"minecraft:feather",tag:{display:{Name:"Roc's Feather",Lore:[Jump higher using this feather.]}}}}`

Now normally, from Minecraft 1.13 onwards, the new /execute command would've been the replacement for the /testfor command, but as I soon found out, the command failed to detect my Roc's Feather and thus could not execute an /effect command that gave me a Jump Boost, for 1 second, at level 3.

I tried remaking my feather from scratch with this command here:

/give @p minecraft:feather{display:{Name:"{\"text\":\"Roc's Feather\",\"color\":\"light_purple\",\"bold\":true,\"italic\":true,\"underlined\":false,\"strikethrough\":false,\"obfuscated\":false}",Lore:["{\"text\":\"Jump higher using this feather.\",\"bold\":false,\"italic\":true,\"underlined\":false,\"strikethrough\":false,\"obfuscated\":false}"]}} 1

But the execute command I placed did not detect this type of uniqueness.

/execute if entity @p[distance=10,nbt={SelectedItem:{id:"minecraft:feather",Count:1b,tag:{display:{Name:"{\"text\":\"Roc's Feather\",\"color\":\"light_purple\",\"bold\":true,\"italic\":true,\"underlined\":false,\"strikethrough\":false,\"obfuscated\":false}",Lore:["{\"text\":\"Jump higher using this feather.\",\"bold\":false,\"italic\":true,\"underlined\":false,\"strikethrough\":false,\"obfuscated\":false}"]}}}}] run effect give @s minecraft:jump_boost 1 3 true

Can somebody tell me what I'm doing wrong here because I cannot even tell what's the issue.


One thing you might try in that final command is to change it from saying @a[distance=10] to @a[distance=..10] because in 1.13 they changed it so that ..10 is less than 10, 10 is exactly 10, and 10.. is greater than ten, with 1..10 being between 1 and 10. So unless you are exactly 10 blocks away nothing will happen.


there are three things actually;

  1. keep in mind that you also need quotes around your text formatting, eg; {\"bold\":\"true\"}.
  2. you don't necessarily need to add formatting if they're false; those tags don't exist if they're false, really, and just clog up your text.
  3. currently, saying distance=10 is looking for everyone at exactly 10 blocks. if you want people at more than 10, you need 10.., and for less, ..10.

hope this helps!


I was pretty obsessed with this problem so I did some tinkering.

I eventually whittled down to the command:

/execute as @p[distance=..10,nbt={SelectedItem:{id:"minecraft:feather"}}] run effect give @s minecraft:jump_boost 1 3 true

This includes suggestions from the other answers, but there are a few notable changes here. Firstly note that I'm not using the complete name of the item, for the sake of quick debugging.

Nextly, I wasn't sure what a count:1b meant, rather than 1, so I eliminated it. I'd love to know.

Most importantly, I changed from execute if entity @p[...] to execute as @p[...]. I did this because I noticed that in the latter half of the execute command (run effect give @s ...), that there is the @s target. This fails because the executor of the command is the command block, not the player. As @s gives the effect to the caster (here the command block), no player receives the effect. I changed the former half of the command (execute if entity ...) to execute as @p[...] here to make the player into the caster, effectively making @s the player.

I was further tempted to then try the simplified command, which was successful:

/effect give @p[distance=..10,nbt={SelectedItem:{id:"minecraft:feather"}}] minecraft:jump_boost 1 3 true

The distance constraint seems excessive at this point, but I left it for creator's sake.

Thank you for loving one of my favourite games, Link's Awakening, and for inspiring me to help bring the spirit of LA into my Minecraft world. I hope to see great content from you in the future.