Player Death Event?

Hi guys, mine code is:

    @Listener
    public void onEntityDeath(DestructEntityEvent.Death e, @First Player p)
    {
        LambdaPlayer potentialPlayer = SCPCore.getInstance().getLambdaPlayers().get(p.getUniqueId());
        LambdaClass lambdaClass = potentialPlayer.getChosenClass();
        if(lambdaClass != null)
        {
            if(lambdaClass.itemsDisappear())
            {
                p.getInventory().clear();
                p.sendMessage(Text.of(TextColors.RED, "You were in " + lambdaClass.getName() + " class, and you have lost your items after death."));
            }
        }
    }

I only want that code effects player that has died, no one else. Anyone knows how to do it>

So the @First gets the first of the specified class types from the causes. As you are checking for the player who will die, it does not make sense to have that player in the cause of their death (The obvious logical exception I belive does not apply here anyway).

You can get the player who actually died in the event itself.

Entity entity = e.getTargetEntity();
if(!(entity instanceof Player)){
    //entity was not player
    return;
}
Player player = (Player)entity;

Or, to keep it all in one line, you should be able to

public void onEntityDeath(DestructEntityEvent.Death e, @Getter("getTargetEntity")Player p)

This will automatically cover the e.getTargetEntity() call and check if its a player or not. Your event would then only be called when the Entity is a player.