1

Im currently able to detect an item in a players inventory and it is only active if the player is holding it while pressing the button that activates the chosen item. But I've been trying to get a chained, conditional, Always active block after it to remove the item after pressing the button. Is it possible to do so?

Merced Flores
  • 11
  • 1
  • 2

1 Answers1

1

Yes:

By using the /clear command you can clear an item from a players inventory /clear @p <or> (playername) (item name) For an example /clear @p minecraft:dirt

Jason_
  • 3,822
  • 9
  • 25
  • 51
  • The issue with this is that the item is very specific, the command i used to summon it is

    /give @p beetroot 1 0 {display:{Name:"Heart of Asmodeus" Lore:["Heart of the Ruler of the Fire Plane.","It is said to have been taken by the Archangel Gallaldriel."]},HideFlags:6,Unbreakable:1}

    Will that effect this at all?

    – Merced Flores Apr 05 '16 at 05:49
  • @MercedFlores Yes, /clear supports dataTags. You can check the wiki for command syntax. However, I recommend you to use custom NBT data instead of trying to detect every single tag on the item for simplification (e.g. /give @p stone 1 0 {specialStone:1b,display:{Name:"Test"}} with /clear @p stone -1 -1 {specialStone:1b}). – Skylinerw Apr 05 '16 at 05:54
  • So is there no way to keep the Lore on the Item? And is it possible to give it an enchantment so it has a glowing effect? – Merced Flores Apr 05 '16 at 06:02
  • @MercedFlores The "specialStone" tag just represents all the data as a whole so you don't have to retype it all in /clear. Add whatever you want to the /give command. – Skylinerw Apr 05 '16 at 06:35