Class NpcLeaveAreaEvent
java.lang.Object
net.risingworld.api.events.Event
net.risingworld.api.events.npc.NpcLeaveAreaEvent
Called when an npc leaves an
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
If a plugin teleports the npc out of the area while handling the
Area. This event is not cancellable,
use Npc.setPosition(Vector3f) or Npc.moveTo(Vector3f) if you want
to keep the npc inside 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
NpcEnterAreaEvent). If an area is removed, this event is not triggered.If a plugin teleports the npc out of the area while handling the
NpcEnterAreaEvent,
this event is triggered immediately. In this case, the old npc position is the position
before the npc entered the area (i.e. it is outside the area).- See Also:
-
Method Details
-
getNpc
-
getArea
-
getNewNpcPosition
Gets the new npc position (outside the area).- Returns:
- the new npc position.
-
getOldNpcPosition
Gets the previous npc position (usually still inside the area, see class description).- Returns:
- the old npc position.
-