It doesn´t work, I dont know why :(

Discussion in 'Bukkit Help' started by rassiermitsooos, Aug 30, 2019.

  1. Offline

    rassiermitsooos

    Code:
    package de.daniel.scoreundheads.events;
    import org.bukkit.ChatColor;
    import org.bukkit.entity.Player;
    import org.bukkit.event.EventHandler;
    import org.bukkit.event.Listener;
    import org.bukkit.event.entity.PlayerDeathEvent;
    import org.bukkit.plugin.PluginManager;
    import org.bukkit.plugin.java.JavaPlugin;
    public class KillEvent extends JavaPlugin implements Listener {
     
     public void onEnable() {
     
     getLogger().info("Scoreplugin has been enabled.");
     PluginManager manager = getServer().getPluginManager();
     manager.registerEvents(this, this);
     
     }
     
      @EventHandler
      public void onKill(PlayerDeathEvent event)
      {
      Player killer = event.getEntity().getKiller();
      Player victim = event.getEntity();
      killer.sendMessage("käk");
      victim.sendMessage(ChatColor.RED + killer.getName() + "hat dich getötet");
      }
    }
     
    Last edited by a moderator: Aug 30, 2019
  2. Online

    timtower Moderator Moderator

    @rassiermitsooos What doesn't work? Did you put a printline in the first line of the method?
     

Share This Page