2

Here is some context: I've made some command block code to make lightning arrows. However, I want the arrows to instantaneously despawn after an arrow is shot. How do I do this?

Here is the command block code if you need it.

execute at @e[type=minecraft:arrow] run summon minecraft:lightning_bolt

2 Answers 2

1
 /execute as @e[type=minecraft:arrow] run data modify @s {Life:0}

This in another command block should instantly destroy every arrow. A similar command using /kill instead should also have the same effect.

1
  • yes, /kill @e[type=minecraft:arrow] should be equivalent
    – Penguin
    May 7, 2021 at 22:18
0

Try using the life tag when summoning it. The command would look like this: /summon arrow ~ ~ ~ {life:1100}. You may need to change the number to alter its lifespan.

3
  • Is there any way to do this without the summon command? Or is that impossible?
    – alt x
    May 7, 2021 at 15:49
  • alt x Perhaps you could make a mod
    – DLynch
    May 7, 2021 at 15:52
  • I think you've misunderstood his question. He wants to instantly kill arrows as soon as they are shot: "However, I want the arrows to instantaneously despawn after an arrow is shot" May 8, 2021 at 17:48

You must log in to answer this question.

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