Skip to content

Instantly share code, notes, and snippets.

@novafurry
Last active April 14, 2021 11:52
Show Gist options
  • Save novafurry/afb23eb0aa0c471f9b06b1cbb180b7a3 to your computer and use it in GitHub Desktop.
Save novafurry/afb23eb0aa0c471f9b06b1cbb180b7a3 to your computer and use it in GitHub Desktop.
Minecraft Commands


Minecraft Commands

Java

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!!"}'}}}]}]

Command Replacers (any text inside of “!!”)

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

PE

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

Command Replacers (any text inside of “!!”)

Selector Item ID
@e
@a
@p
@s
@r?
Player Username
Any valid item id
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment