Skip to main content
deleted 69 characters in body
Source Link
pppery
  • 4k
  • 8
  • 29
  • 50

You can do this using /replaceitem and a technique similar to the one described in Fabian Röling's answer to this related question:

/execute if entity @s[nbt={Inventory:[{Slot:0b,tag:{discard:1b}}]}] run replaceitem entity @s hotbar.0 air
…
/execute if entity @s[nbt={Inventory:[{Slot:8b,tag:{discard:1b}}]}] run replaceitem entity @s hotbar.8 air
/execute if entity @s[nbt={Inventory:[{Slot:9b,tag:{discard:1b}}]}] run replaceitem entity @s inventory.0 air
…
/execute if entity @s[nbt={Inventory:[{Slot:35b,tag:{discard:1b}}]}] run replaceitem entity @s inventory.26 air
/execute if entity @s[nbt={Inventory:[{Slot:-106b,tag:{discard:1b}}]}] run replaceitem entity @s weapon.offhand air

I haven't had the opportunity to test this yet, but it should work.

You can do this using /replaceitem and a technique similar to the one described in Fabian Röling's answer to this related question:

/execute if entity @s[nbt={Inventory:[{Slot:0b,tag:{discard:1b}}]}] run replaceitem entity @s hotbar.0 air
…
/execute if entity @s[nbt={Inventory:[{Slot:8b,tag:{discard:1b}}]}] run replaceitem entity @s hotbar.8 air
/execute if entity @s[nbt={Inventory:[{Slot:9b,tag:{discard:1b}}]}] run replaceitem entity @s inventory.0 air
…
/execute if entity @s[nbt={Inventory:[{Slot:35b,tag:{discard:1b}}]}] run replaceitem entity @s inventory.26 air
/execute if entity @s[nbt={Inventory:[{Slot:-106b,tag:{discard:1b}}]}] run replaceitem entity @s weapon.offhand air

I haven't had the opportunity to test this yet, but it should work.

You can do this using /replaceitem and a technique similar to the one described in Fabian Röling's answer to this related question:

/execute if entity @s[nbt={Inventory:[{Slot:0b,tag:{discard:1b}}]}] run replaceitem entity @s hotbar.0 air
…
/execute if entity @s[nbt={Inventory:[{Slot:8b,tag:{discard:1b}}]}] run replaceitem entity @s hotbar.8 air
/execute if entity @s[nbt={Inventory:[{Slot:9b,tag:{discard:1b}}]}] run replaceitem entity @s inventory.0 air
…
/execute if entity @s[nbt={Inventory:[{Slot:35b,tag:{discard:1b}}]}] run replaceitem entity @s inventory.26 air
/execute if entity @s[nbt={Inventory:[{Slot:-106b,tag:{discard:1b}}]}] run replaceitem entity @s weapon.offhand air
Post Undeleted by pppery
Post Deleted by pppery
Source Link
pppery
  • 4k
  • 8
  • 29
  • 50

You can do this using /replaceitem and a technique similar to the one described in Fabian Röling's answer to this related question:

/execute if entity @s[nbt={Inventory:[{Slot:0b,tag:{discard:1b}}]}] run replaceitem entity @s hotbar.0 air
…
/execute if entity @s[nbt={Inventory:[{Slot:8b,tag:{discard:1b}}]}] run replaceitem entity @s hotbar.8 air
/execute if entity @s[nbt={Inventory:[{Slot:9b,tag:{discard:1b}}]}] run replaceitem entity @s inventory.0 air
…
/execute if entity @s[nbt={Inventory:[{Slot:35b,tag:{discard:1b}}]}] run replaceitem entity @s inventory.26 air
/execute if entity @s[nbt={Inventory:[{Slot:-106b,tag:{discard:1b}}]}] run replaceitem entity @s weapon.offhand air

I haven't had the opportunity to test this yet, but it should work.