TransWikia.com

SelectItem doesn't work but Inventory does

Arqade Asked by haroba2021 on June 3, 2021

I just found out how item tags work and now I’m trying to check if the player is holding the sword with the tag. When I try to /execute if entity @e[nbt={SelectedItem:[{tag:{awakened:1b}}]}] the test fails

but when i Try this command it works. /execute if entity @e[nbt={Inventory:[{tag:{awakened:1b}}]}] it works. I am holding the item and it still doesn’t want to work

If you are wondering this is the give command I used to get the tagged sword.

/give @p minecraft:diamond_sword{Unbreakable:1,HideFlags:1,Enchantments:[{id:"minecraft:sharpness",lvl:8}],awakened:1b,display:{Name:'[{"text":"Awakened arkhalis"}]'}} 1

One Answer

SelectedItem is not a list and therefore does not take square brackets. Try /execute if entity @e[nbt={SelectedItem:{tag:{awakened:1b}}}] instead.

Answered by pppery on June 3, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP