Ah. That makes more sense. Thanks for the edit. Im confused on why cancelling the damage event will still cause the death screen. Even says in the description for the function that canceling the event will cause the function to return false.
Returns whether or not this event will cause the entity to die if the event is not cancelled.
Are you sure the event is even firing? If not check that the listener is registered
It’s possible call DeathEvent without death screen? @Listener
public void onPlayerTakeDamage(DamageEntityEvent event,@First Player player){
if(event.willCauseDeath()) {
event.setCancelled(true);
Call DeathEvent
}
I don’t know if that still works, but you might be able to revive the player by setting their health 1 tick after the death event. That would leave all items dropped, as no event is cancelled and iirc it removes the death screen.