Getting when a player is near a certain block

Discussion in 'Plugin Development' started by Rufflez, Jul 18, 2014.

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

    Rufflez

    Hello, i have no idea how to do this but, how would i make so if a player was say three or four blocks away from ice it would send them a potion effect or a message etc.
     
  2. Offline

    THEREDBARON24

    You would either have to watch the player move event and get distance from the block or run a repeating task and see if the player is within so many blocks. Not sure if it is possible, but you can spawn an entity at the location and use .getNearrbyEntities... This eliminates the need to use the distance method (Which is reportedly very taxing on the system).
     
  3. Offline

    JustinsCool15

    Is the ice random or at set locations?
     
Thread Status:
Not open for further replies.

Share This Page