I want to make something in Minecraft with security doors but I can’t find out how to locate a specific item in a players inventory shulker box, ender chest, or hand. I need assistance to find the correct command for pocket edition.


You are unable to locate an item in a shulker box or enderchest - this will require game file editing.

Using commands, you are able to clear their inventory of tnt, or link any other command.

First, custom command if tnt is found:

execute at @a[nbt={Inventory:[{id:"minecraft:tnt"}]}] run <Your command here>

If you would like for no player to have tnt in their inventory, run

clear @a tnt

every tick (using a repeating command block)

  • @MarcoGeertsma Hi Marco - /toggleitem is not a vanilla minecraft command. If I am mistaken, please link a reputable source. Thanks – Jayden Jan 8 '19 at 9:43
  • @MarcoGeertsma Hi again Marco - /recipe is only for the Java edition of the game. -Detailed here: minecraft.gamepedia.com/Commands#recipe – Jayden Jan 8 '19 at 9:45
  • Your entirely right, my source seems to provide wrong information. Ill remove my comments to prevent discussion. Your answer covers it then – Marco Geertsma Jan 8 '19 at 9:48
  • Remark: The /clear command does not remove items from shulker boxes or the ender chest, at least that's how it works in Java Minecraft. – Fabian Röling Jan 8 '19 at 17:54
  • 1
    Sure, but not in this case. Your answer is pretty much as good as it gets, since what the asker wants is impossible in MCPE. – Fabian Röling Jan 9 '19 at 6:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.