#(pgini) Detecting whenever an entity enters an area

31 messages · Page 1 of 1 (latest)

untold locust
#

I need a way to detect whenever an entity such as an arrow or a mob enters an area

velvet badgeBOT
#

(pgini) Detecting whenever an entity enters an area

velvet badgeBOT
#

Hi I'm AutoThreadBot! Don't mind me, I'll just be adding the helper team to this thread so they can see it. A human will get to you soon.

untold locust
#

Currently I can only detect players

#

In the previous rewrite of the plugin it was checked every tick, but we are trying to be more lag friendly

#

And strangely enough there's no entityMoveEvent

#

How does Denizen do it?

#

!e entity enters area

stoic yokeBOT
untold locust
#

!e entity enters|exits area

stoic yokeBOT
# untold locust !e entity enters|exits area
Group

Entity

**WARNING**

cancelling this event will have different results depending on the cause. Teleporting the entity away 1 tick later might be safer.

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.

Has Player

When the entity is a player. - this adds switches flagged:<flag name> + permission:<node>, in addition to the <player> link.

Context

<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 determines cancelled + cancelled:false.

untold locust
#

Oh

#

Sadge times

#

Is there a way to somehoe do this without relying on paper?

cedar thistle
#

why would you not use paper

untold locust
#

If you code for spigot by extension you support Paper

ripe crescent
ripe crescent
#

And even that isn't as valid since Paper has their own plugin site now

#

And there's stuff like Modrinth

untold locust
#

🤷 I'm not the one dictating this stuff, but we do want to support as many things as possible

#

By coding for Spigot you support all their forks, by coding Forge you also support NewForged, etc

#

Easier this way

#

But yeah we decided to change it so we can make it without being laggy

ripe crescent
#

Every relevant fork is a Paper fork

#

Paper is the only relevant Spigot fork afaik

cedar thistle
#

you can make certain features paper-only

untold locust
#

Can't really work for this type of plugin, also our target community is varied since the plugin is old, no way to know what weird types of servers people will use so its better to play it safe

#

But yeah we changed it to be timer based with a cooldown so we can safely check every tick without it being too laggy