How to /clear a specific spawn egg in from the inventory
I want to remove a specific spawn egg from a player's inventory but instead the two commands removes every spawn eggs. The first one remove every one while the second one removes nothing (but the command block says that it is correct):
/clear @a spawn_egg 0 5
/clear @a spawn_egg 52 5
How can I do to remove only the specific spawn egg of the creeper without removing all of them?
Best Answer
Try doing this: /clear (username) spawn_egg (item data) (amount)
For example, "/clear player123 spawn_egg 52 43" would clear 43 spider eggs from player123's inventory.
However, it is different if you have Essentials/EssentialsX installed.
I'm not entirely sure how to clear specific items, but I'm pretty sure "/clear player123 spawn_egg:52 43" would clear 43 spider eggs from player123.
Have a great day, I hope this helped! :)
Pictures about "How to /clear a specific spawn egg in from the inventory"
How do you give a specific spawn egg?
A spawn egg's ID is 383 and can be obtained using the /give command. However, this will only give a player a white egg with white spots, which cannot actually be used, unless a player specifies the data tag.How do you get different spawn eggs in Minecraft?
Spawn eggs can be obtained only in Creative mode or using commands. In Creative mode, the player can press pick block on an existing mob to obtain their respective egg. Spawn eggs are also available in the Creative inventory. There are 66 spawn eggs in Bedrock Edition and 64 spawn eggs in Java Edition.What command do you use to clear your inventory in Minecraft?
You can use the command /clear [targets] [item] [maxCount] , where: targets is optional. It is the name of the player (or a target selector) whose inventory you wish to clear. If no player is specified, it will default to the player running the command.How to get Hidden Spawn Eggs with 1 command - Minecraft PE/BE 1.16
Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.
Images: Flora Westbrook, Dana Tentis, Artem Savchenko, Ryutaro Tsukata