Skip "Respawn" "Title Screen" dialog on death

Hello, is it possible to skip the screen that appears when you die (with the “Respawn” and “Title Screen” buttons)?
I want to know if a plugin that makes the player instantly respawn when they die can be made. I have seen this in Bukkit, and they do have a plugin for it.

Thanks!

Hi, I didn’t try it yet but maybe Graveyard could be helpful :

However, remove the “Respawn” screen means cancelling the death event.

Well, I thought maybe this could do?

At least this is what Bukkit has:

@EventHandler
public void RespawnScreen(PlayerDeathEvent e){
final Player p = e.getEntity();
plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new Runnable(){
public void run(){
if (p.isDead()){
((CraftPlayer)p).getHandle().playerConnection.a(new PacketPlayInClientCommand(EnumClientCommand.PERFORM_RESPAWN));
}
}
});
}

}

Bukkit API and Sponge API are really different and they don’t handle events the same way. But I am not a developper so I have no clue if there is a way or not to achieve what you are looking for :x

Oh, ok D:

Sorry

What if you listen DamageEntityEvent and if willCauseDeath() you simulate the death without actually killing it?
Cause right now you Sponge doesn’t let you manage packets D:

You can use Player#respawnPlayer to force the player to respawn when on the death screen.

Hey!

I don’t really know where to incorporate the “Player#respawnPlayer” and all that. That’s why I’m requesting a plugin for it, if that’s possible.

Thanks!