Class NpcEnterAreaEvent
java.lang.Object
net.risingworld.api.events.Event
net.risingworld.api.events.npc.NpcEnterAreaEvent
Called when an npc enters 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
Teleporting the npc out of the area while handling this event immediately triggers a
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
-
getArea
-
getNewNpcPosition
Gets the new npc position (inside the area).- Returns:
- the new npc position.
-
getOldNpcPosition
Gets the previous npc position (still outside the area).- Returns:
- the old npc position.
-