How do I delete a specific item thrown on the ground?

How do I delete a specific item thrown on the ground? - A Woman Checking a Brown Long Sleeves Shirt

I want to create an item which you cannot get rid of, so if you throw it on the ground that item (snowball) will be deleted. But I don't want to kill all items using /kill @e[type=Item], I just want to kill just the snowball. Can anyone help?



Best Answer

You will have to use scoreboards for this:

  1. Setup a dummy scoreboard (ex. /scoreboard objectives add Sample_OBJ dummy)

  2. Add this command to at the most a 4 tick clock (hopper or fill clock will do): /scoreboard players set @e[type=Item] Sample_OBJ 1 {Item:{id:minecraft:wool}}

  3. Add Another command block that needs To be on a clock: /kill @e[type=Item,score_Sample_OBJ_min=1]

You need a scoreboard because you can't put NBT in selectors/there is no ID tag in item selectors.




Pictures about "How do I delete a specific item thrown on the ground?"

How do I delete a specific item thrown on the ground? - Ground level of old fashioned photo camera with lens and black strap placed on rug in room with flowerpots and wooden shelf on blurred background
How do I delete a specific item thrown on the ground? - Retro photo camera on floor surface
How do I delete a specific item thrown on the ground? - Pair of boots placed on floor in shabby room



How do you delete specific items from the ground in Minecraft?

Firstly, press the T key on your keyboard to open the chat. Yet, you can change this hotkey in the game settings. One of the most popular and fastest ways to clear items is the kill command. First, type /kill @e[type=item] in the chat and press enter to remove all dropped items in your Minecraft world instantly.

How do you Despawn all items on the ground?

The command is \u201c/kill @e[type=item]\u201d. That will delete EVERY dropped item on the ground currently. An example of clearing a specific item would be \u201c /kill @e[type=dirt] \u201c; that will delete ALL DIRT blocks that are DROPPED. The process is similar on Bedrock Edition of Minecraft.

Is there a command to delete blocks in Minecraft?

You can clear items from a player's inventory using the /clear command in Minecraft. Let's explore how to use this cheat (game command).



Ground Clearing Items Command




More answers regarding how do I delete a specific item thrown on the ground?

Answer 2

Here is a solution that uses scoreboard tags. It will tag any item matching the exact criteria which could include custom names, lore, enchantments, any NBT information. This tag can then be used to target only those items to be killed. In my example, a snowball named Test will be the only item that gets killed. You can throw out unnamed snowballs and they will be safe.

You need two command blocks in a chain.

The first command block is RepeatUnconditionalAlways Active and it's command is:

scoreboard players tag @e[type=Item] add KillItem {Item:{id:"minecraft:snowball",tag:{display:{Name:Test}}}} 

The second command block is ChainUnconditionalAlways Active and it's command is:

kill @e[tag=KillItem]

Answer 3

To destroy a certain item, rename it and use

/kill @e[type=Item, name={item name here}]

That should do the trick. You could also look up a way to destroy all of one item.

Answer 4

/kill @e[Type=Item.{Item or Block}.{Item}]

Example : /kill @e[Type=Item.Item.leather]

Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.

Images: Mikhail Nilov, E M, E M, Alexander Grigorian