#(zyphhh) Player use portal event not firing

44 messages · Page 1 of 1 (latest)

modest blaze
#

Getting no debug when I use the end_portal from the end
Acts as normal, sends me to the default Overworld instead of the world the script should determine.

Script: https://paste.denizenscript.com/View/128850

Debug: https://paste.denizenscript.com/View/128849

charred sedgeBOT
icy ingotBOT
#

(zyphhh) Player use portal event not firing

icy ingotBOT
#

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.

little lantern
#

which one of these scripts is the one not working?

charred sedgeBOT
teal sable
#

I'm assuming the matcher checks the <context.from> location, which isn't always the end_portal block

#

eg if you fly above the portal and and fall into it, it should fire, but when you walk into it, the event fires before the player's location is inside the portal block (most often than not air)

#

!e enters portal

misty harnessBOT
# teal sable !e enters portal
Group

Entity

Event Lines

<entity> enters portal

Triggers

when an entity enters a portal. That is, when the entity touches a portal block.

Has Player

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

Has NPC

when the entity that entered the portal is an NPC.

Context

<context.entity> returns the EntityTag.
<context.location> returns the LocationTag of the portal block touched by the entity.

Has Known Location

True - this adds switches in:<area> + location_flagged:<flag name>.

teal sable
#

You could use this event to detect only end portals as the context locations gives you the portal block rather than the location the player is teleporting from

#

ie check if it matches an end portal, apply a flag with a short expiration & use a flag matcher in your uses portal event

#

i think this would work (if the enters event fires before the uses event)

#

yeah it does, you can just do that

modest blaze
# teal sable yeah it does, you can just do that

That appears to not be the issue, im getting the same result when I added that in, infact I went as far as removing the switch entirely. Still no response from the event.

It seems that the end portal that teleports the player back to the Overworld does not fire this event?

Updated Script: https://paste.denizenscript.com/View/128887

Updated Debug: https://paste.denizenscript.com/View/128888

#

There is probably a workaround with player changes world but I'd prefer to do it on the portal event

modest blaze
warm hamlet
#

So on player enters portal doesn't fire for end portals, but after does?

modest blaze
#

no no sorry if i explained that wrong

#

on/after player enters portal fires fine
on player uses portal does not fire on end portals in the end

little lantern
#

@modest blaze are you still encountering this issue?

little lantern
#

after some testing on my server, the same exact issue is occurring for me as well. "on enters", "after enters", and "on uses" work in the overworld, but only "on enters" and "after enters" work in the end. (logs https://paste.denizenscript.com/View/129854)

modest blaze
flat pasture
#

Are you talking about the end gateways, or the end portal at 0,0?

modest blaze
#

the end portal at 0,0

#

end gateways are diffrent

flat pasture
#

The meta mentions that this is currently only applicable to Nether Portals.

teal sable
#

That's not the same event

#

!e uses portal

misty harnessBOT
# teal sable !e uses portal
Group

Player

Event Lines

player uses portal

Switches

from:<block> to only process the event if the block the player teleported from matches the LocationTag matcher provided.
to:<block> to only process the event if the block the player teleported to matches the LocationTag matcher provided.

Triggers

when a player enters a portal.

Has Player

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

Context

<context.from> returns the location teleported from.
<context.to> returns the location teleported to (can sometimes be null).
<context.can_create> returns whether the server will attempt to create a destination portal.
<context.creation_radius> returns the radius that will be checked for a free space to create the portal in.
<context.search_radius> returns the radius that will be checked for an existing portal to teleport to.

Determine

LocationTag to change the destination.
"CAN_CREATE:<ElementTag(Boolean)>" to set whether the server will attempt to create a destination portal.
"CREATION_RADIUS:<ElementTag(Number)>" to set the radius that will be checked for a free space to create the portal in.
"SEARCH_RADIUS:<ElementTag(Number)>" to set the radius that will be checked for an existing portal to teleport to.

Has Known Location

True - this adds switches in:<area> + location_flagged:<flag name>.

Cancellable

True - this adds <context.cancelled> and determines cancelled + cancelled:false.

flat pasture
#

I know it's not the primary event in question; they had a script that uses that event also, so just wanted to point that out, just in case.

little lantern
#

^ the strange part to me is that when i tested it, i had three script events, on player enters portal, after player enters portal, and on player uses portal. All three would fire when I entered an end portal in the overworld, but only the first two would fire when I entered the end portal in the end. i'm not sure if this is an intended reaction, because if it is, then this can probably be closed. but if it's not, then this is a bug that should be looked into, although it's unlikely to be a bug with Denizen and rather with Spigot.

nimble jungle
#

dear mother of god

#

i'm looking through source right now

brittle summit
#

lol whys there like 10 portal events 😭

nimble jungle
#

This can have some wrongs but how I understand the code and from testing is;

Mojang/Spigot always fires EntityPortalEnterEvent (on <entity> enters portal, works for players and entities) when someone steps into an EndPortalBlock, but fires also EntityPortalEvent when a non-player enters it . But Denizen does not use the EntityPortalEvent but PlayerPortalEvent for on player uses portal.

Spigot makes it so that PlayerRespawnEvent fires, when a player uses the END_PORTAL inside the end with END_PORTAL reason. PlayerTeleportEvent with END_PORTAL reason is also called when a Player is not inside the END and inside a EndPortal, additionally to the EntityPortalEnterEvent explained above.

Things I don't know yet is why if you're inside the end and go through the portal, the teleport reason is UNKNOWN.

#

no idea where that goes but spigot seems to pass the respawn reason to it

#

I also couldn't find the place where PlayerPortalEvent is actual fired

#

But to detect people going from the end to the overworld through the portal, we should probably listen to the PlayerRespawnEvent and add the getRespawnReason to context.tags

night wedgeBOT
#
Changed to Feature

Thread is now a Feature thread. This indicates a request for a new feature to the plugin, that both (A) does not already exist and (B) reasonably can be added. If you are unsure whether this applies, use </helpthread:1028674284870180883> to change back to a normal help thread.

nimble jungle
# nimble jungle I also couldn't find the place where PlayerPortalEvent is actual fired

Called when a player is about to teleport because it is in contact with a portal which will generate an exit portal.
Technically it shouldn't fire, because no exit portal generates in the end right? Only the obsidian platform generates everytime someone teleports through an end portal into the end