#how to check for item tag in offhand?

1 messages · Page 1 of 1 (latest)

sour fern
#

This works:
execute store result score gun stats run data get entity @s SelectedItem.components.minecraft:custom_data.gun

but this doesnt :
execute store result score gun_offhand_test stats run data get entity @s Inventory[{Slot:-106b}].components.minecraft:custom_data.gun

how to check for item tag in offhand?

glossy aurora
#

execute if items

sour fern
#

isnt there just new name for this: Inventory[{Slot:-106b}]? (it worked on 1.20.4)

#

why this dont work?

#

/execute if items entity @s weapon.offhand *[custom_data={gun:true}] run say a

#

and why this is working

#

/execute if items entity @s weapon.offhand *[custom_data~{gun:true}] run say a

#

what does this ~ mean?