Class NpcEnterAreaEvent

java.lang.Object
net.risingworld.api.events.Event
net.risingworld.api.events.npc.NpcEnterAreaEvent

public final class NpcEnterAreaEvent extends Event
Called when an npc enters an Area. This event is not cancellable, use Npc.setPosition(Vector3f) or Npc.moveTo(Vector3f) if you want to keep the npc out of the area.

Note: Npcs are only simulated in proximity to players, so this event is only triggered for npcs which are actually moving (i.e npcs near a player). The areas of an npc are tracked as long as at least one plugin listens for this event (or for the NpcLeaveAreaEvent).

Teleporting the npc out of the area while handling this event immediately triggers a NpcLeaveAreaEvent. Setting the position of an npc which is currently ridden by a player has no effect (the npc follows the player).
See Also:
  • Method Details

    • getNpc

      public Npc getNpc()
      Gets the npc that entered the area.
      Returns:
      the npc.
    • getArea

      public Area getArea()
      Gets the Area the npc has entered.
      Returns:
      the Area.
    • getNewNpcPosition

      public Vector3f getNewNpcPosition()
      Gets the new npc position (inside the area).
      Returns:
      the new npc position.
    • getOldNpcPosition

      public Vector3f getOldNpcPosition()
      Gets the previous npc position (still outside the area).
      Returns:
      the old npc position.