#(pgini) Detecting whenever an entity enters an area
31 messages · Page 1 of 1 (latest)
(pgini) Detecting whenever an entity enters an area
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.
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
!e entity enters|exits area
Entity
cancelling this event will have different results depending on the cause. Teleporting the entity away 1 tick later might be safer.
<entity> enters|exits <area>
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.
When the entity is a player. - this adds switches flagged:<flag name> + permission:<node>, in addition to the <player> link.
<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.
True - this adds <context.cancelled> and determines cancelled + cancelled:false.
why would you not use paper
If you code for spigot by extension you support Paper
Check every tick lol
Basically no one uses Spigot on modern versions, unless you have external reasons (I.e. being on the Spigot website) there's really no reason
And even that isn't as valid since Paper has their own plugin site now
And there's stuff like Modrinth
🤷 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
we know, but the point we're making is that paper is the de facto core software at this point. spigot is missing a ton of useful and important features and is reluctant to accept commits from downstream
you can make certain features paper-only
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