3

For some reason when I do:

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

It kills all arrows.

The correct output should be it only killing arrows that are in the ground. How can I fix this?

2 Answers 2

4

/kill command syntax:

/kill <target>

It does not support NBT input. You will instead have to label the target based on their data first, such as with /scoreboard, and then target them based on the label after.

1.9

No objective necessary.

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

1.8

Objective required.

/scoreboard objectives add kill dummy

Then for detection:

/scoreboard players set @e[type=Arrow] kill 1 {inGround:1b}
/kill @e[type=Arrow,score_kill_min=1]
4
  • Okay, yes, that explains a bunch of problems I've had with the kill command. It also taught me a new thing about scoreboards I should have already known. This worked, thank you.
    – Pingyoping
    Commented Mar 17, 2016 at 4:36
  • Oh, I just realized that this is not going to work in 1.8 is it? Because "tag" was added in 1.9. I should of mentioned Is there a way to do this in 1.8?
    – Pingyoping
    Commented Mar 17, 2016 at 4:40
  • @Pingyoping Yes, modified my post to include it.
    – Skylinerw
    Commented Mar 17, 2016 at 11:29
  • Is there any way to do this for bedrock edition? Commented Apr 21, 2020 at 19:25
1

I don't know in which version it became possible, but for anyone who is interested, the modern answer to this is:

/kill @e[type=arrow,nbt={inGround:1b}]

(Be warned that nbt selectors are said to be relatively expensive though.)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .