yes this is needed, for some people who think they are unkillable

This commit is contained in:
ZeroEpoch1969 2018-07-14 00:28:45 -07:00
parent 04089973f0
commit 46cc6d37c3
No known key found for this signature in database
GPG Key ID: E0AAB104FB9F8FDF

View File

@ -0,0 +1,38 @@
package me.totalfreedom.totalfreedommod.command;
import me.totalfreedom.totalfreedommod.rank.Rank;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
@CommandPermissions(level = Rank.OP, source = SourceType.BOTH)
@CommandParameters(description = "Kill someone with force, for those who REALLY need to die.", usage = "/<command> <playername>")
public class Command_forcekill extends FreedomCommand
{
@Override
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
{
if (!plugin.al.isAdmin(sender) && !senderIsConsole)
{
playerSender.setHealth(0);
return true;
}
if (args.length < 1)
{
return false;
}
final Player player = getPlayer(args[0]);
if (player == null)
{
msg(PLAYER_NOT_FOUND);
return true;
}
player.setHealth(0);
return true;
}
}