How To Clear Specific Items In Minecraft
Posted by
Is now mildly ok at 1.13+ commands b/c I took time to learn them
3 years ago
How can I clear an item that has a specific name from a player?
Minecraft 1.14.2 pre1
I tried doing this with clear @p minecraft:magenta_glazed_terracotta{tag:{display:{Name:'{"text":"A"}'}}} and clear @p minecraft:magenta_glazed_terracotta{tag:{display:{Name:"A"}}} but neither worked.
Am I close to the correct command? Thanks.
Log in or sign up to leave a comment
level 1
· 3y
you were pretty close. it is the first command, but without the "tag".
clear @p minecraft:magenta_glazed_terracotta{display:{Name:'{"text":"A"}'}} the tag part is what holds all the item NBT that is special, which is the part you can test for. it basically works the same way as the give command.
(if it needed to be included, you could do something like this clear @p minecraft:magenta_glazed_terracotta{id:"minecraft:diamond"} which obviously doesn't make any sense.)
level 2
Op · 3y Is now mildly ok at 1.13+ commands b/c I took time to learn them
level 1
· 3y Knows some commands
does it HAVE to be name? If not, then you can use custom nbt tags
level 2
Op · 3y Is now mildly ok at 1.13+ commands b/c I took time to learn them
Well, in my case, yeah. I'm trying to make a basic "scrolling" chest using the 1.14 feature where you can /clear held items in an inventory.
I plan on clearing the named held item and detecting the chest slot being empty, and swapping the current chest with the other chest (the "next page"). Afterwards I will just put the cleared item back in the original chest.
The item name would be "Next Page" to clearly indicate to someone what happens when they click it.
How To Clear Specific Items In Minecraft
Source: https://www.reddit.com/r/MinecraftCommands/comments/bphusy/how_can_i_clear_an_item_that_has_a_specific_name/
Posted by: dilworthcenry1987.blogspot.com

0 Response to "How To Clear Specific Items In Minecraft"
Post a Comment