Is there an event if an entity touches a certain block?

Discussion in 'Plugin Development' started by gmfreaky, Apr 3, 2011.

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

    gmfreaky

    I wonder if there is an event that occurs whenever an entitys touches a block. I want to make a plugin that kills every non-player thing that touches a rails.
     
  2. Offline

    notanimposter

    you could try getting the position of your rails and your player, and then seeing if they are within .3 or so blocks from one another. idk what the context is, so idk
     
  3. Offline

    bergerkiller

    No EntityMove event exists, so you need to schedule your task. (tick interval).
    Simply check for all entities if it is a LivingEntity and if it is not a Player. If the block below this entity is rails (getLocation().add(0, -1, 0).getBlock().getState() instanceof Rails) you can remove/kill it.
     
  4. Offline

    7eggert

    What about Minecraft Mania? It can clean the rail when needed.
     
Thread Status:
Not open for further replies.

Share This Page