As reported by @Muqsit , dead players will get re-banned from the server if they get unbanned and try to join the server again. This occurs because the player's saved health is zero, causing the respawn sequence to be executed again, causing the player to get banned again.
This is rather a tricky bug to fix because of how messed up respawning is right now - #1567 is a key showstopper here.
You can check on PlayerPreLoginEvent if the hardcore is enabled && if the player's health is <= 0. If it is you will do @rmdir("players/".$event->getPlayer()->getName().".dat");
No hacks or tricks
Why thumbs down?
Can't you do this when you load the player data?
@MalakasPlayzMC I don't think you know how hardcore servers work. The player data is still very needed. It contains the player's skindata and other things. Deleting it would be too much to lose aside from it being a hacky measure.
Relates to #1567
Most helpful comment
@MalakasPlayzMC I don't think you know how hardcore servers work. The player data is still very needed. It contains the player's skindata and other things. Deleting it would be too much to lose aside from it being a hacky measure.