I'm trying to make that when a player dies, the console writes this command /rp removeall (name of the guy who died), but i am getting (For example, my name in minecraft is Lucas325) rp removeallLucas325 (and i think the console is getting this like a STRING not like a cmd) Code: public class RpDelete implements Listener { @EventHandler public void quandoMorrer(PlayerDeathEvent e) { Player p = e.getEntity(); if(p.isDead()) { Bukkit.getConsoleSender().sendMessage("rp removeall" + p.getName()); } } }
Add a space between removeall and the ": "rp removeall " + p.getName() also why are you checking p.isDead()? The PlyerDeathEvent only fires when the player dies.
@Lucas325 I assume that you can use e.getPlayer() instead of e.getEntity, since the PlayerDeathEvent will always be a player dying. Code: Player p = e.getPlayer();