TransWikia.com

How do I target a specific item on the ground?

Arqade Asked by Kaii Ross Baird on December 14, 2020

I’m making a map and there’s a waterfall that keeps spawning squids, I’ve got a repeating command block that kills the squid but they drop their ink sacks minecraft:dye 0 and it looks messy, What I want is a way to /kill the ink sacks so it looks a little bit cleaner.

One Answer

You can use the coordinates of the bottom area of the waterfall for that:

/kill @e[type=item,x=?,y=?,z=?,dx=?,dy=?,dz=?]

Replace ? with the coordinates and size of the area.

Or you can just disable mob spawning:

/gamerule doMobSpawning false

Or mob loot dropping:

/gamerule doMobLoot false

If you really want to target it by item type, you can do this:

/kill @e[type=item,nbt={Item:{id:"minecraft:ink_sak"}}]

Note: This is the current syntax, for versions 1.13 and above. "dye" with a data value of 0 was the old way of doing this, that's why the question contains that. You can see the command for 1.12.2 and before in the edit history of this answer.

Correct answer by Fabian Röling on December 14, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP