Skip to content

Post Respawn Event#8770

Open
MrScopes wants to merge 16 commits into
SkriptLang:dev/featurefrom
MrScopes:postrespawn
Open

Post Respawn Event#8770
MrScopes wants to merge 16 commits into
SkriptLang:dev/featurefrom
MrScopes:postrespawn

Conversation

@MrScopes

Copy link
Copy Markdown
Contributor

Problem

Currently, there is no support for https://jd.papermc.io/paper/26.2/com/destroystokyo/paper/event/player/PlayerPostRespawnEvent.html
To make changes to the user's player state, you have to use

on respawn:
 wait ...
 ...

this can be inconstent. PlayerPostRespawnEvent is fired after the respawn event.
take this from PlayerRespawnEvent

Called when a player respawns.
If changing player state, see PlayerPostRespawnEvent because the player is "reset" between this event and that event and some changes won't persist.

Solution

after [player] respawn[ing]

Testing Completed

on respawn:
    broadcast "&aon respawn:"
    broadcast "&b%player% &c%respawn location%"
    if respawn location is a bed:
        broadcast "&dbed"

after respawn:
    broadcast "&aafter respawn:"
    broadcast "&b%player% &c%respawn location%"
    if respawn location is a bed:
        broadcast "&dbed"

# the example I gave for the docs
after respawn:
    if respawn location is a bed:
        broadcast "%player% respawned at their bed at %respawn location%"
    else if respawn location is a respawn anchor:
        broadcast "%player% respawned at their anchor at %respawn location%"
    else:
        broadcast "%player% respawned at %respawn location%"
javaw_a5VPpw4Dkg javaw_Muukgt5G8G image

Supporting Information

I also modernized the respawn location expression and condition by moving it to the player module, and I updated some of the code in the classes.


Completes: #8769
Related: none
AI assistance: CoPilot

@MrScopes
MrScopes requested a review from a team as a code owner July 12, 2026 21:19
@MrScopes
MrScopes requested review from Efnilite and Pesekjak and removed request for a team July 12, 2026 21:19
@MrScopes MrScopes changed the title Postrespawn Post Respawn Event Jul 12, 2026

@AnOwlBe AnOwlBe left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

few things

Comment thread src/main/java/ch/njol/skript/events/SimpleEvents.java Outdated
Comment thread src/main/java/ch/njol/skript/events/SimpleEvents.java Outdated

@AnOwlBe AnOwlBe left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

supplier!

@AnOwlBe AnOwlBe left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you have my read only approval 🔥

Comment thread src/main/java/org/skriptlang/skript/bukkit/entity/player/PlayerModule.java Outdated
@skriptlang-automation skriptlang-automation Bot added the needs reviews A PR that needs additional reviews label Jul 14, 2026
MrScopes and others added 6 commits July 18, 2026 20:36
Co-authored-by: SirSmurfy2 <82696841+Absolutionism@users.noreply.github.com>
Co-authored-by: SirSmurfy2 <82696841+Absolutionism@users.noreply.github.com>
Co-authored-by: SirSmurfy2 <82696841+Absolutionism@users.noreply.github.com>

@AnOwlBe AnOwlBe left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

meep

}

@Override
public boolean init(Expression<?>[] exprs, int matchedPattern, Kleenean isDelayed, ParseResult parseResult) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
public boolean init(Expression<?>[] exprs, int matchedPattern, Kleenean isDelayed, ParseResult parseResult) {
public boolean init(Expression<?>[] expressions, int matchedPattern, Kleenean isDelayed, ParseResult parseResult) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't required

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no it isn't its just something that could be changed - hence why its a comment review not a requested changes review

@Absolutionism Absolutionism left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Almost there

MrScopes and others added 3 commits July 18, 2026 20:58
Co-authored-by: SirSmurfy2 <82696841+Absolutionism@users.noreply.github.com>
Co-authored-by: SirSmurfy2 <82696841+Absolutionism@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs reviews A PR that needs additional reviews

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants