@@ -0,0 +1,1188 @@
+package io.github.satoshinm.WebSandboxMC.bukkit;%0A%0Aimport io.github.satoshinm.WebSandboxMC.bridge.PlayersBridge;%0Aimport io.github.satoshinm.WebSandboxMC.bridge.WebPlayerBridge;%0Aimport org.bukkit.entity.Entity;%0Aimport org.bukkit.event.EventHandler;%0Aimport org.bukkit.event.Listener;%0Aimport org.bukkit.event.entity.EntityDamageEvent;%0Aimport org.bukkit.event.entity.EntityDeathEvent;%0A%0Apublic class EntityListener implements Listener %7B%0A%0A    private final WebPlayerBridge webPlayerBridge;%0A%0A    public EntityListener(WebPlayerBridge webPlayerBridge) %7B%0A        this.webPlayerBridge = webPlayerBridge;%0A    %7D%0A%0A    @EventHandler(ignoreCancelled = true)%0A    public void onEntityDeath(EntityDeathEvent event) %7B%0A        Entity entity = event.getEntity();%0A%0A        String username = webPlayerBridge.entityId2Username.get(entity.getEntityId());%0A        if (username == null) %7B%0A            return;%0A        %7D%0A%0A        EntityDamageEvent entityDamageEvent = entity.getLastDamageCause();%0A        // TODO: how to get killer?%0A        EntityDamageEvent.DamageCause damageCause = entityDamageEvent != null ? entityDamageEvent.getCause() : null;%0A%0A        webPlayerBridge.notifyDied(username, damageCause);%0A    %7D%0A%7D%0A

Add EntityListener for GH-32, option to die on disconnect