1
0
mirror of https://github.com/mcMMO-Dev/mcMMO.git synced 2026-02-18 17:53:00 +01:00

Added /heal and /suicide. Corrected some things in the settings file.

Signed-off-by: nossr50 <nossr50@gmail.com>
This commit is contained in:
nossr50
2010-11-29 22:58:27 -08:00
parent 2debb79568
commit 43c933ebb7
2 changed files with 53 additions and 6 deletions

View File

@@ -35,10 +35,50 @@ public class vminecraftCommands{
cl.register("/slay", "slay", "Kill target player");
cl.register("/ezmodo", "invuln", "Toggle invulnerability");
cl.register("/ezlist", "ezlist", "List invulnerable players");
cl.register("/heal", "heal", "heal yourself or other players");
cl.register("/suicide", "suicide", "kill yourself... you loser");
cl.registerAlias("/playerlist", "/who");
cl.registerAlias("/suicide", "/wrists");
}
//Heal
public static boolean heal(Player player, String[] args)
{
if(vminecraftSettings.getInstance().cmdHeal)
{
if (args[1] == null){
if (player.getHealth() < 20){
vminecraftChat.gmsg("Your health is restored");
return true;
}
else if (args[1] != null){
Player playerTarget = etc.getServer().matchPlayer(args[1]);
if (playerTarget != null){
playerTarget.setHealth(20);
vminecraftChat.gmsg(Colors.Blue + "You have healed " + playerTarget.getColor() + playerTarget.getName());
vminecraftChat.gmsg(Colors.Blue + "You have been healed by " + player.getColor() + player.getName());
return true;
}
else if (playerTarget == null){
vminecraftChat.gmsg(Colors.Rose + "Couldn't find that player");
return false;
}
}
}
}
return false;
}
//Suicide
public static boolean suicide(Player player, String[] args)
{
if(vminecraftSettings.getInstance().cmdSuicide)
{
player.setHealth(0);
return true;
}
return false;
}
//=====================================================================
//Function: teleport (/tp)
//Input: Player player: The player using the command