Players pushing entities event?

Discussion in 'Plugin Development' started by kreashenz, Apr 21, 2013.

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

    kreashenz

    Is there an event for when a player pushes an entity? I need to be able to cancel this, because as the mobs are frozen with a potion effect, they can still get pushed, and I do not want that. Thanks!
     
  2. Offline

    Tzeentchful

    I have had to deal with this problem before. Sadly there is no event for the pushing of a entity and you can't stop it without a serous amount of reflection. The best workaround would be to have a task that teleports the mob/player to the position that should stay in every so many ticks.
     
  3. Offline

    kreashenz

    Tzeentchful I tried doing that, and I didn't know how to get the location from a HashMap, so someone suggested putting a slowness potion on the mob to make them immobilized, which seemed to work, till I pushed them.. Can you tell me what would go inside the public void run() ? This is the HashMap I was using
    Code:java
    1. public HashMap<UUID,Location> mobLoc = new HashMap<UUID, Location>();
     
Thread Status:
Not open for further replies.

Share This Page