[Solved] DestructEntityEvent.Death - how to get killer?

I have simply code:

@Listener
public void onEntityDeath(DestructEntityEvent.Death event) {
    plugin.logger.error("Event fired");
    Optional<Player> playerOptional = event.getCause().first(Player.class);
    
    if (playerOptional.isPresent()) {
        plugin.logger.error("Player is present");
        Player player = (Player) playerOptional;

When I kill some entity, event get fired, but killer (Cause) is ever absent. Am I doing anything wrong ?
(Using Sponge 630)

The Cause contains a DamageSource, not a Player.

You are true, but how can I get the Player from it ? I have tried something like that, but still don’t work.

@Listener
public void onEntityDeath(DestructEntityEvent.Death event) {
plugin.logger.error("Event fired");
Optional<DamageSource> dsOptional = event.getCause().first(DamageSource.class);

if (dsOptional.isPresent() && dsOptional instanceof Player) {
    plugin.logger.error("Player is present");
    Player player = (Player) dsOptional.get();

it would be dsOptional.get() instanceof Player

Actually, Player is not a DamageSource. You need to get an EntityDamageSource and then check if it holds a Player.

Source is never present. What’s wrong ?

@Listener
public void onEntityDeath(DestructEntityEvent.Death event) {
    plugin.logger.error("Event fired");
    Optional<EntityDamageSource> source = event.getCause().first(EntityDamageSource.class);

    if (source.isPresent()) plugin.logger.error("source is present");

    if (source.isPresent() && source.get().getSource() instanceof Player) {
        plugin.logger.error("Player is present");
        Player player = (Player) source.get().getSource();

The following works on the latest build of Sponge

    @Listener
    public void onEntityDeath(DestructEntityEvent.Death event) {
        Optional<EntityDamageSource> optDamageSource = event.getCause().first(EntityDamageSource.class);
        if (optDamageSource.isPresent()) {
            EntityDamageSource damageSource = optDamageSource.get();
            Entity killer = damageSource.getSource();
            if (killer instanceof Player) {
                System.out.println("Player " + killer + " killed entity " + event.getTargetEntity());
            }
        }
    }

I just downloaded latest Sponge version (634) and It started to work. Looks like there was some problem (missing implentation?) in version (630) which I has used before. Thanks for your help.