Name | entity enters|exits area |
Event Lines | <entity> enters|exits <area> |
Triggers | when an entity enters or exits a noted area (cuboid, ellipsoid, or polygon). On Spigot servers, only fires for players. Paper is required for other mob types. |
Generated Examples | on bat enters polygon:
on monster enters area: |
Has Player | When the entity is a player. - this adds switches 'flagged:<flag name>' + 'permission:<node>', in addition to the '<player>' link. |
Contexts | <context.area> returns the area object that was entered or exited.
<context.cause> returns the cause of the event. Can be: WALK, WORLD_CHANGE, JOIN, QUIT, TELEPORT, VEHICLE.
<context.to> returns the location the entity moved to (might not be available in exit events).
<context.from> returns the location the entity moved from (when available, depending on cause).
<context.entity> returns the entity that entered/exited an area.
|
Cancellable | True - This adds <context.cancelled> and determine 'cancelled' or 'cancelled:false' |
Group | Entity |
Warning(s) | cancelling this event will have different results depending on the cause. Teleporting the entity away 1 tick later might be safer. |
Source | https://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/events/entity/AreaEnterExitScriptEvent.java#L29 |
Name | entity enters vehicle |
Event Lines | entity enters vehicle
<entity> enters <entity> |
Triggers | when an entity mounts another entity. |
Generated Examples | on entity enters vehicle:
on entity enters entity: after entity enters vehicle: on animal enters entity: |
Has Player | when the entity that mounted the vehicle is a player. - this adds switches 'flagged:<flag name>' + 'permission:<node>', in addition to the '<player>' link. |
Has NPC | when the entity that mounted the vehicle is an NPC. |
Contexts | <context.vehicle> returns the EntityTag of the mounted vehicle.
<context.entity> returns the EntityTag of the entering entity.
|
Cancellable | True - This adds <context.cancelled> and determine 'cancelled' or 'cancelled:false' |
Has Location | True - This adds the switches 'in:<area>', 'location_flagged:<flag>', ... |
Group | Entity |
Source | https://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityEntersVehicleScriptEvent.java#L17 |