Skip to content

EssentialsSpawn NoSuchMethodError getRespawnLocation #6459

@CrystalD5

Description

@CrystalD5

Type of bug

Error in console

/ess dump all output

https://essentialsx.net/dump.html?bytebin=NhqmJ0I0Dr

Error log (if applicable)

https://gist.github.com/CrystalD5/9f09730bffa20c75d053463a8e68c158

Bug description

When a player dies Essentials fails to handle the PlayerRespawnEvent do to the method Player.getRespawnLocation() not existing.

Steps to reproduce

Start up a server in any version from 1.16.1 to 1.20.3 (I used 1.16.5)
Add Essentials and EssentialsSpawn
Edit config:

respawn-at-home: true
respawn-at-home-bed: true

Restart the server
Use bed as player
Make player die

Expected behaviour

Player respawns at their bed without error

Actual behaviour

The player respawns at their bed, however it is due to the plugin failing to handle event resulting in an error to the console

Additional Information

EssentialsSpawn uses this condition in the EssentialsSpawnPlayerListener.java on line 52-56 to determine which method to use:

if(VersionUtil.getServerBukkitVersion().isHigherThanOrEqualTo(VersionUtil.v1_16_1_R01)) {
  respawnLocation = user.getBase().getRespawnLocation();
} else { // For versions prior to 1.16.
  respawnLocation = user.getBase().getBedSpawnLocation();
}

However I could not find Player.getRespawnLocation() in https://helpch.at/docs until version 1.20.4-R0.1 resulting in an Exception on servers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug: unconfirmedPotential bugs that need replicating to verify.

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions