Ok so im making this really dumb plugin because i am new. but i thought this would work and it does not for i dont know why
public final class MyFirstPlugin extends JavaPlugin implements Listener {
@Override
public void onEnable() {
System.out.println("[DeathBan] Plugin Enabled");
getServer().getPluginManager().registerEvents(this, this);
}
@EventHandler
public void onPlayerDeath(PlayerDeathEvent event){
String playerName = "Name";
Player p = Bukkit.getPlayer(playerName);
Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "ban" + p);
}
}
So what it does is really simple. it see's a player has died. and the console bans them. It dosnt do anything in console like it should