Summary
When running SimpleClaimSystem v1.12.3.2 on Folia 1.21.8-5-ver/1.21.8, a NoSuchMethodError occurs due to direct instantiation of PlayerPostRespawnEvent with a constructor signature that no longer exists. This breaks post-respawn logic and may cause plugin instability after player deaths.
Error log:
java.lang.NoSuchMethodError: 'void com.destroystokyo.paper.event.player.PlayerPostRespawnEvent.<init>(org.bukkit.entity.Player, org.bukkit.Location, boolean)'
at SimpleClaimSystem.jar/fr.xyness.SCS.Listeners.FoliaClaimEvents.lambda$onPlayerDeath$2(FoliaClaimEvents.java:115) ~[SimpleClaimSystem.jar:?]
...
Root cause
- In
FoliaClaimEvents.java, the plugin manually constructs and fires PlayerPostRespawnEvent, but the constructor signature is not present in Folia/Paper 1.21.8.
- This API usage is not supported; respawn events should be handled via
PlayerRespawnEvent and post-respawn logic should be scheduled using Folia's scheduler.
Example affected code:
See FoliaClaimEvents.java
@EventHandler
public void onPlayerDeath(PlayerDeathEvent event) {
Player player = event.getPlayer();
Bukkit.getAsyncScheduler().runAtFixedRate(instance, task -> {
if(player != null && player.isOnline()) {
if(!player.isDead()) {
instance.executeSync(() -> {
Location currentLocation = player.getLocation();
PlayerPostRespawnEvent e = new PlayerPostRespawnEvent(player, currentLocation, false);
Bukkit.getPluginManager().callEvent(e);
});
task.cancel();
}
} else {
task.cancel();
}
}, 250, 250, TimeUnit.MILLISECONDS);
}
How to reproduce
- Start server with SimpleClaimSystem on Folia 1.21.8
- Kill a player
- Observe NoSuchMethodError and broken claim post-respawn logic
Expected behavior
- No exceptions
- Post-respawn claim effects (bossbar, auto-fly, automap, etc.) apply correctly after death
Suggested fix
- Remove all direct instantiation of
PlayerPostRespawnEvent.
- Refactor to use
PlayerRespawnEvent handler and, for post-respawn actions, schedule a delayed task via Folia's player scheduler:
@EventHandler
public void onPlayerRespawn(PlayerRespawnEvent event) {
Player player = event.getPlayer();
player.getScheduler().execute(plugin, (ignored) -> {
// post-respawn logic here
}, null, 1L);
}
- Ensure all post-respawn claim management logic is moved from manual event firing to this pattern.
References:
Label: bug
Version: 1.12.3.2
Server: Folia 1.21.8
API: 1.21.8-R0.1-SNAPSHOT
Summary
When running SimpleClaimSystem v1.12.3.2 on Folia 1.21.8-5-ver/1.21.8, a NoSuchMethodError occurs due to direct instantiation of
PlayerPostRespawnEventwith a constructor signature that no longer exists. This breaks post-respawn logic and may cause plugin instability after player deaths.Error log:
Root cause
FoliaClaimEvents.java, the plugin manually constructs and firesPlayerPostRespawnEvent, but the constructor signature is not present in Folia/Paper 1.21.8.PlayerRespawnEventand post-respawn logic should be scheduled using Folia's scheduler.Example affected code:
See FoliaClaimEvents.java
How to reproduce
Expected behavior
Suggested fix
PlayerPostRespawnEvent.PlayerRespawnEventhandler and, for post-respawn actions, schedule a delayed task via Folia's player scheduler:References:
Label: bug
Version: 1.12.3.2
Server: Folia 1.21.8
API: 1.21.8-R0.1-SNAPSHOT