Well i am trying to make a kill command so when you use it you kill the player.....so this is what i have...i coded it by myself but its not fully working, ill gladly accept help.

if (command.startsWith("kill") && playerRights >= 3) {
try {
String otherPName = command.substring(10);
int otherPIndex = PlayerHandler.getPlayerID(otherPName);
if (otherPIndex != -1) {
p.dealDamage(99);
p.sM("You have been killed by " + playerName);
} else {
sM("No such Player.");
}
} else {
sM("Try Entering the player you wish to kill.");
}
}