Skip to main content
added 5 characters in body; edited title
Source Link
pppery
  • 4k
  • 8
  • 29
  • 50

How to remove specific NBT items from player inventory without data packs

How to remove specific NBT items from player inventory without data packs

I created a level-based minigame, and every level, it checks your inventory, and makes sure you don't have any forbidden items. I make items forbidden my adding a tag to them: discard:1b. Any items that should get removed from the inventory at the end of each level get this tag, so they are discarded.

I then started working on the clear command, and I found that you cannot remove items based upon NBT, but rather only by item, although you can add an NBT specification to items afterwards.

I then saw this answer, and got excited, but then I realized it used datapacks, and that would not be an option for me.
I looked around a bit more, and discovered this, who had a very similar problem to me, but its only answer was something I already knew how to do, and it wasn't enough.

How to remove specific NBT items from player inventory

I created a level-based minigame, and every level, it checks your inventory, and makes sure you don't have any forbidden items. I make items forbidden my adding a tag to them: discard:1b. Any items that should get removed from the inventory at the end of each level get this tag, so they are discarded.

I then started working on the clear command, and I found that you cannot remove items based upon NBT, but rather only by item, although you can add an NBT specification to items afterwards.

I then saw this answer, and got excited, but then I realized it used datapacks, and that would not be an option for me.
I looked around a bit more, and discovered this, who had a very similar problem to me, but its only answer was something I already knew how to do, and it wasn't enough.

How to remove specific NBT items from player inventory without data packs

I created a level-based minigame, and every level, it checks your inventory, and makes sure you don't have any forbidden items. I make items forbidden my adding a tag to them: discard:1b. Any items that should get removed from the inventory at the end of each level get this tag, so they are discarded.

I then started working on the clear command, and I found that you cannot remove items based upon NBT, but rather only by item, although you can add an NBT specification to items afterwards.

I then saw this answer, and got excited, but then I realized it used datapacks, and that would not be an option for me.
I looked around a bit more, and discovered this, who had a very similar problem to me, but its only answer was something I already knew how to do, and it wasn't enough.

Changed links
Source Link
One 2 Many
  • 12.8k
  • 9
  • 52
  • 91

I created a level-based minigame, and every level, it checks your inventory, and makes sure you don't have any forbidden items. I make items forbidden my adding a tag to them: discard:1b. Any items that should get removed from the inventory at the end of each level get this tag, so they are discarded. 

I then started working on the clear command, and I found that you cannot remove items based upon NBT, but rather only by item, although you can add an NBT specification to items, later afterwards. 

I then saw this answer:How can I specify only NBT in the /clear command, not an item?this answer, and got excited, but then I realized it used datapacks, and that would not be an option for me. I
I looked around a bit more, and discovered this: How can I remove items with custom tags from a players inventory in 1.14?this, who had a very similar problem to me, but its only answer was something I already knew how to do, and it wasn't enough.

I created a level-based minigame, and every level, it checks your inventory, and makes sure you don't have any forbidden items. I make items forbidden my adding a tag to them: discard:1b. Any items that should get removed from the inventory at the end of each level get this tag, so they are discarded. I then started working on the clear command, and I found that you cannot remove items based upon NBT, but rather only by item, although you can add an NBT specification to items, later. I then saw this answer:How can I specify only NBT in the /clear command, not an item?, and got excited, but then I realized it used datapacks, and that would not be an option for me. I looked around a bit more, and discovered this: How can I remove items with custom tags from a players inventory in 1.14?, who had a very similar problem to me, but its only answer was something I already knew how to do, and it wasn't enough.

I created a level-based minigame, and every level, it checks your inventory, and makes sure you don't have any forbidden items. I make items forbidden my adding a tag to them: discard:1b. Any items that should get removed from the inventory at the end of each level get this tag, so they are discarded. 

I then started working on the clear command, and I found that you cannot remove items based upon NBT, but rather only by item, although you can add an NBT specification to items afterwards. 

I then saw this answer, and got excited, but then I realized it used datapacks, and that would not be an option for me.
I looked around a bit more, and discovered this, who had a very similar problem to me, but its only answer was something I already knew how to do, and it wasn't enough.

Source Link

How to remove specific NBT items from player inventory

I created a level-based minigame, and every level, it checks your inventory, and makes sure you don't have any forbidden items. I make items forbidden my adding a tag to them: discard:1b. Any items that should get removed from the inventory at the end of each level get this tag, so they are discarded. I then started working on the clear command, and I found that you cannot remove items based upon NBT, but rather only by item, although you can add an NBT specification to items, later. I then saw this answer:How can I specify only NBT in the /clear command, not an item?, and got excited, but then I realized it used datapacks, and that would not be an option for me. I looked around a bit more, and discovered this: How can I remove items with custom tags from a players inventory in 1.14?, who had a very similar problem to me, but its only answer was something I already knew how to do, and it wasn't enough.