Read entities inventory:
Must be done in command block. To trigger redstone or another commandblock, you must set the main commmandblocks’ setttings to Always Active On, and set the command block type to repeat, then place a comparator to get redstone output
/execute if entity !!SELECTOR!![nbt={Inventory:[{id:"!!ITEM_ID!!",tag:{display:{Name:'{"text":"!!Item_Display_Name!!"}'}}}]}]
Selector | Item ID | Item Display Name |
---|---|---|
@e @a @p @s @r? Player Username |
Any valid item id | The name of the item in the inventory GUI |
Read entities inventory:
Must be done in command block. To trigger redstone or another commandblock, you must set the main commmandblocks’ setttings to Always Active On, and set the command block type to repeat, then place a comparator to get redstone output
/clear !!SELECTOR!! !!ITEM_ID!! 0 0
Selector | Item ID |
---|---|
@e @a @p @s @r? Player Username |
Any valid item id |