I'm trying to create a mechanism that will detect an item with a name of, for example, bob. Whenever the item "bob" is on the ground, can a command block detect it and then kill it? I've tried /kill @e[type=Item,name=bob] but it doesn't work. Any help?
Sorry for the thread necromancy, but I've been looking for the solution for this for two hours.
My situation: I am running a lightly modded MC 1.15.2 using the Forge Modloader. I hate the wandering trader; I find him to be a nuisance, particularly in my creative test worlds. Not nearly as bad of a hassle is that even after you've killed the trader, you still have the Leads and Leather laying around from the trader llamas.
So, I set up four repeating command blocks set to "Always active:
To get rid of the wandering trader:
/kill @e[type=minecraft:wandering_trader]
To kill the llamas:
/kill @e[type=minecraft:trader_llama]
To get rid of the Leads (note that punctuation and capitalization are essential):
/kill @e[type=item, name="Lead"]
And to get rid of the Leather:
/kill @e[type=minecraft:item, name="Leather"]
Done. It works like a charm, and I did it without mucking about with player goals and scoreboards.
Sorry for the thread necromancy, but I've been looking for the solution for this for two hours.
My situation: I am running a lightly modded MC 1.15.2 using the Forge Modloader. I hate the wandering trader; I find him to be a nuisance, particularly in my creative test worlds. Not nearly as bad of a hassle is that even after you've killed the trader, you still have the Leads and Leather laying around from the trader llamas.
So, I set up four repeating command blocks set to "Always active:
To get rid of the wandering trader:
/kill @e[type=minecraft:wandering_trader]
To kill the llamas:
/kill @e[type=minecraft:trader_llama]
To get rid of the Leads (note that punctuation and capitalization are essential):
/kill @e[type=item, name="Lead"]
And to get rid of the Leather:
/kill @e[type=minecraft:item, name="Leather"]
Done. It works like a charm, and I did it without mucking about with player goals and scoreboards.
I do not know what version you are on, but based on that command, it seems like you are on Bedrock Edition.
I don't think you are able to detect the item and then /kill it. But, you can /kill whatever entity you want. If you want to /kill a dropped item, do /kill @e [type=item,name=bob], If it is a mob such as a zombie, you do /kill @e [type=zombie,name=bob] If you want to /kill an entity with the name of "Minecraft Is Cool", then you must type, /kill @e [type=item,name="Minecraft Is Cool"]. I am not sure why it does not work for you, but the commands I stated only work for Bedrock Edition.
If you are on Bedrock, it is impossible to detect an item and then /kill it. You can place a repeated command block to /kill your item every tick, so there would be little to nothing delay when you /kill the item. But lets say when you /kill the item and you are trying to power another command block when it /kills the item, you can connect a repeater from your repeated /kill command block to a command block you want. Hope this helps.
I'm trying to create a mechanism that will detect an item with a name of, for example, bob. Whenever the item "bob" is on the ground, can a command block detect it and then kill it? I've tried /kill @e[type=Item,name=bob] but it doesn't work. Any help?
Check my Twitter here for absolutely nothing.
You have to use scoreboards. So start off creating the objective we will use to track the item.
Now we need to assign the item a value only if it's name is bob: This will assign all items named bob that are on the ground a value of 1 for tileType.Now we can simply kill any item with tileType = 1.
If you plan on doing anything to that item before you kill it, make sure the kill command executes after you have taken care of anything you need.Quick correction on NBT structure (item format within the "Item" tag for item entities):
Minecraft-things: http://skylinerw.com
More Minecraft-things: https://sourceblock.net
Guides for command-related features (eventually moving to Source Block): https://github.com/skylinerw/guides
I primarily hang out in the /r/MinecraftCommands discord, where there's a lot of people that help with commands: https://discord.gg/QAFXFtZ
Their corresponding subreddit: https://www.reddit.com/r/MinecraftCommands/
Yay it worked
Thanks guys.
Check my Twitter here for absolutely nothing.
Sorry for the thread necromancy, but I've been looking for the solution for this for two hours.
My situation: I am running a lightly modded MC 1.15.2 using the Forge Modloader. I hate the wandering trader; I find him to be a nuisance, particularly in my creative test worlds. Not nearly as bad of a hassle is that even after you've killed the trader, you still have the Leads and Leather laying around from the trader llamas.
So, I set up four repeating command blocks set to "Always active:
To get rid of the wandering trader:
To kill the llamas:
To get rid of the Leads (note that punctuation and capitalization are essential):
And to get rid of the Leather:
Done. It works like a charm, and I did it without mucking about with player goals and scoreboards.
You can save a couple of commands by teleporting them into the void (a negative Y value), no drops to handle.
Just testing.
Doesn't this command work pretty well?
==Links==
๐๐๐๐จ๐ง๐ ๐๐ก๐๐ง๐ง๐๐ฅ- https://www.youtube.com/channel/UCQYroXqdZtYBnyspneetBGA/featured
๐๐ง๐ฌ๐ญ๐๐ ๐ซ๐๐ฆ- https://www.instagram.com/cowsdabest_yt/?hl=en
๐๐ฐ๐ข๐ญ๐ญ๐๐ซ- https://twitter.com/cowsdabestyt
๐๐ข๐ฌ๐๐จ๐ซ๐- https://discord.gg/H2NfhpQ
==DISCLAIMER!==
Please credit me if you are going to use it in a video or a map!
I do not know what version you are on, but based on that command, it seems like you are on Bedrock Edition.
I don't think you are able to detect the item and then /kill it. But, you can /kill whatever entity you want. If you want to /kill a dropped item, do /kill @e [type=item,name=bob], If it is a mob such as a zombie, you do /kill @e [type=zombie,name=bob] If you want to /kill an entity with the name of "Minecraft Is Cool", then you must type, /kill @e [type=item,name="Minecraft Is Cool"]. I am not sure why it does not work for you, but the commands I stated only work for Bedrock Edition.
If you are on Bedrock, it is impossible to detect an item and then /kill it. You can place a repeated command block to /kill your item every tick, so there would be little to nothing delay when you /kill the item. But lets say when you /kill the item and you are trying to power another command block when it /kills the item, you can connect a repeater from your repeated /kill command block to a command block you want. Hope this helps.
I don't think Bedrock has Forge Modloader
==Links==
๐๐๐๐จ๐ง๐ ๐๐ก๐๐ง๐ง๐๐ฅ- https://www.youtube.com/channel/UCQYroXqdZtYBnyspneetBGA/featured
๐๐ง๐ฌ๐ญ๐๐ ๐ซ๐๐ฆ- https://www.instagram.com/cowsdabest_yt/?hl=en
๐๐ฐ๐ข๐ญ๐ญ๐๐ซ- https://twitter.com/cowsdabestyt
๐๐ข๐ฌ๐๐จ๐ซ๐- https://discord.gg/H2NfhpQ
==DISCLAIMER!==
Please credit me if you are going to use it in a video or a map!