1

More broken code, specific /clear with item names

RageLokiCat 7/22/14 12:15 pm
333
7/22/2014 1:52 pm
/clear RageLokiCat minecraft:anvil 0 1 {tag:{display:{Name:"A"}}}

This is just a test, but in the end I'm going to need to clear all tools with default names. This says that there were no items to clear, and I don't know why.
Posted by
RageLokiCat
Level 21 : Expert Pony
20

  Have something to say?

JoinSign in

1

Skylinerw
07/22/2014 1:52 pm
Level 16 : Journeyman System
RageLokiCat/clear RageLokiCat minecraft:anvil 0 1 {tag:{display:{Name:"A"}}}

This is just a test, but in the end I'm going to need to clear all tools with default names. This says that there were no items to clear, and I don't know why.

The /clear command's dataTags (as well as /give) start within the "tag" tag of the item format:
{
id:minecraft:stone,
Damage:0,
Count:1,
Slot:0,
tag:{
[extra item data]
}
}


Both /clear and /give already have the root item data defined (apart from "Slot" for both and "Count" for /clear) in their syntax:
/give <player> <id> [Count] [Damage] {tag}
/clear <player> <id> [Damage] [Maximum Amount (not Count)] {tag}


Thus all you need to do is remove the "tag" tag:

/clear RageLokiCat minecraft:anvil 0 1 {display:{Name:"A"}}
1

Welcome