How to get nearby LivingEntities from an entity

Discussion in 'Plugin Development' started by scarabcoder, Mar 25, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    scarabcoder

    I am making a plugin where when an explosion happens, blocks go everywhere. I know how to make it so when a block lands, it does something. How do I get LivingEntites within a one block radius of the block? You can't do Block.getNearbyEntites. Any help?
     
  2. scarabcoder
    All you need to do is get the location of the block and then loop through all the entities in the world. In the loop, get the entity's location and then compare it to the block's location. If the difference is greater than x value, do something. Hope this helps a bit :)
     
  3. Offline

    scarabcoder

    Thanks, it works for me now! :)
     
Thread Status:
Not open for further replies.

Share This Page