How can I prevent the spreadplayers command from putting the zombies in trees?

How can I prevent the spreadplayers command from putting the zombies in trees? - Frame with text placed on blackboard with sterile mask

I'm using the /spreadplayers command to randomly spawn zombies around the player for an adventure map. The problem with this is that there are trees and the zombies all end up on the trees and it gets boring. I've tried every method I can think of to fix this, and they either flat out don't work, or take a lot of time to do. If someone can help with this, that would be amazing, as I've been at it for a while.

  • I'm on minecraft 16w05b
  • I've tried using /execute @e ~ ~ ~ detect /testforblock ~ ~-1 ~
  • I've tried to re-spread all entities above a certain height
  • I've tried to give anything standing on leaves or above a certain height a score

I don't know what else to try or do! — if anyone can either successfully do one of these or think of another method, please tell me!



Best Answer

I do not have a solution as to how to use the /spreadplayers command to make this work. But, another solution to your problem (if the randomness is not that important) would be using the /summon command.

If you want to scatter the zombies around manually you will have to create multiple Command blocks though, but you can just copy-paste the commands and change out the coordinates.




Pictures about "How can I prevent the spreadplayers command from putting the zombies in trees?"

How can I prevent the spreadplayers command from putting the zombies in trees? - From above of face mask on blackboard with I Cant Breathe title during COVID 19 pandemic
How can I prevent the spreadplayers command from putting the zombies in trees? - Woods Covered With Snow
How can I prevent the spreadplayers command from putting the zombies in trees? - Unrecognizable woman holding paw of dog



What is the Spreadplayers command in Minecraft?

You can use the /spreadplayers command to teleport all targeted players to random locations in a specified region.



How to Use the /spreadplayers Command - Minecraft Tutorial




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

Images: Brett Sayles, Brett Sayles, Mikhail Nilov, Ivan Babydov