Minecraft Commands – How to Use the Spread Players Command in the Air

minecraft-commandsminecraft-java-edition

I'm trying to use the /spreadplayers command to make a rain of arrows. Therefore, I need them to spread in the air, 10 blocks or so above the ground or player.

/execute @a[score_Arrows_min=1] ~ ~ ~ /summon Arrow ~ ~10 ~
/execute @a[score_Arrows_min=1] ~ ~ ~ /spreadplayers ~ ~ 0 5 false @e[type=Arrow]

These commands make the arrows teleport to the ground, instead of placing them in the air.

How do I use the /spreadplayers command to spread entities in the air?

Best Answer

Spreadplayers will always teleport entities to solid ground (no water, air, or lava).

You can instead spread them, then immediately teleport them upwards:

/execute @a[score_Arrows_min=1] ~ ~ ~ /summon Arrow ~ ~3 ~
/execute @a[score_Arrows_min=1] ~ ~ ~ /spreadplayers ~ ~ 0 5 false @e[type=Arrow]
/execute @a[score_Arrows_min=1] ~ ~ ~ /tp @e[type=Arrow] ~ ~10 ~