Exploding arrow command not working

Exploding arrow command not working - Red and White Dart on Darts Board

I'm trying to get arrow to explode on impact but the command I'm using doesn't work. It should work but there is an error message that comes up most of the time saying:

Arrow did not match the required data structure

The command has worked a couple of times but mostly it just comes up with the error.

/testfor @e[type=Arrow] {inGround:1b}


Best Answer

The command is structured correctly.

Most commands are processed equal to the number of targets obtained by the selector first, which is the case for /testfor. Every single arrow in the world has its NBT data checked one at a time.

However, the output of the command block only shows the result of the last iteration. While an arrow could have been found during the process, the last arrow found may not match.

You should use a comparator to check the actual success of the command, or run the command yourself in the chat and scroll through the return messages until you find one that's a success.


But in general, /testfor is not helpful and you should not be using it in this situation. It will not allow you to target which arrow was found. You've already run into the case of there being arrows that don't match, so any subsequent commands will be targeting them.

Use /scoreboard instead, to either assign a score pre-1.9 or a "tag" in 1.9:

/scoreboard players tag @e[type=Arrow,tag=in] remove in
/scoreboard players tag @e[type=Arrow,tag=!in] add in {inGround:1b}

And you'd then be able to target those specific arrows by selecting the "in" label:

/say @e[type=Arrow,tag=in]



Pictures about "Exploding arrow command not working"

Exploding arrow command not working - Close-Up Shot of Marketing Strategy Text
Exploding arrow command not working - Turned on Neon Light Signage
Exploding arrow command not working - Round Blue and Gray Arrow Symbol



How do you activate explosive arrows in Minecraft?

/kill @e[type=arrow,nbt={inGround:1b}] When you have both command blocks ready, place a lever on the first command block marked by the red box in the image above and activate it. Doing so will give arrows that fire from either a crossbow or bow an explosion effect similar to TNT in Java Minecraft.

What command make arrows explode?

kill @e[type=arrow] On firing, your arrows will now explode!



EXPLOSIVE ARROWS with 1 command in Minecraft [Link in Description]




More answers regarding exploding arrow command not working

Answer 2

Recently, in 1.9, there was a huge update on command blocks and NBT data.

Try in 1.8.9 or earlier to see if this problem still exists. If so, the command is not compatible with 1.9.

Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.

Images: Pixabay, Eva Bronzini, Clem Onojeghuo, Kelly