Hey there. I'm coding my own FFA-plugin. The problem: If I heal, feed and teleport the player on PlayerDeathEvent he respawns, but keeps invisible to other players. Months ago this method worked well. Is there any new way, which I could use?
I used this method about a year ago to respawn players instantly after beeing killed, so that they don't need to click respawn. But now this method doesn't work anymore.
That method shouldn't have been working at all, it was just a fluke. ¯\_(ツ)_/¯ I don't think there's a clean way to do this yet. You could do something like cancelling the RespawnPacket during DataPacketSendEvent and calling Player->respawn() (which um, is a protected method in api3, but maybe reflection hack it?). Or better... just cancel the EntityDeathEvent assuming you don't have any Player->kill() calls in your plugin. Listen to EntityDeathEvent on the HIGHEST priority and cancel the event if the final damage is greater than player's health. You'll still need a way to respawn the player with emptied inventories, emptied crafting grid, xp, health, saturation, respawn position etc for which I think you'll need to gain access to Player->respawn() using reflection hacks.