The SelectedItem
tag is a compound, which surrounds data in curly brackets. You've declared it as a string instead with the remainder of the item data at the root of the player entity data.
You need to place the item data inside, along with the id
tag. As well, the item format dictates that all data that is not the root id
, Damage
, Slot
, or Count
, must be placed within a single tag
compound.
On top of that, be aware that most extra item data will not be auto-corrected for datatypes. You've declared the enchantment's id
and lvl
tags tags as integers, but when the enchantments are obtained through normal means these tags will be shorts. You would end up needing multiple commands to check for the varied datatypes if you do not declare it as a short as well (which is done by appending a whole numerical value with an "s").
Revised /give
command:
/give @p minecraft:fire_charge 1 0 {display:{Name:"Fireball"},ench:[{id:60s,lvl:10s}]}
Resulting /testfor
command (if not for example, I recommend not relying on /testfor
and instead use multi-target friendly methods such as adding labels with /scoreboard
):
/testfor @a {SelectedItem:{id:"minecraft:fire_charge",tag:{display:{Name:"Fireball"},ench:[{id:60s,lvl:10s}]}}}
To make detection easier, you can use custom item data instead of trying to detect every single tag on the item. This way you can change the actual data for balancing purposes without having to go back to fix all commands relying on that data.
For example, the following adds a "specialFireCharge" byte tag with a value of 1 to the item:
/give @p minecraft:fire_charge 1 0 {specialFireCharge:1b,display:{Name:"Fireball"},ench:[{id:60s,lvl:10s}]}
And the following would be what you'd use to label the player as a result:
/scoreboard players tag @a[tag=HoldingCharge] remove HoldingCharge
/scoreboard players tag @a[tag=!HoldingCharge] add HoldingCharge {SelectedItem:{tag:{specialFireCharge:1b}}}
Best Answer
First I'll run you through how to use the fill command:
Lets replace this 4x4 square with air First find the coordinates of the bottom corner of the square: The coordinates are in the highlighted box Write this down and then lets find the top corner of the other side of the square
When your done writing both coordinates down place them in a commandblock, it should look like this:
/fill 39.529 26 58.418 36.335 27 61.391
these are the two sets of coordinates (They can be rounded) /fill (39.529 26 58.418) (36.335 27 61.391)
After this you have to place the name of the block you want to replace the square with, after the coordinates
/fill 39.5 26 58.5 36.3 27 61.3 minecraft:air
And poof it's gone
As for alternative ways this is one of the best, unless you want to download 3rd party tools like WorldEdit.