Package com.sijobe.spc.command

Source Code of com.sijobe.spc.command.Kill

package com.sijobe.spc.command;

import com.sijobe.spc.wrapper.CommandSender;
import com.sijobe.spc.wrapper.Player;

import net.minecraft.src.DamageSource;

import java.util.List;

/**
* Kills the player that runs the command
*
* @author simo_415
* @version 1.0
*/
@Command (
   name = "kill",
   description = "Kills the current player",
   videoURL = "http://www.youtube.com/watch?v=iNzdikZvnyI",
   version = "1.0"
)
public class Kill extends StandardCommand {
   /**
    * @see com.sijobe.spc.wrapper.CommandBase#execute(net.minecraft.src.ICommandSender, java.util.List)
    */
   @Override
   public void execute(CommandSender sender, List<?> params) {
      Player player = super.getSenderAsPlayer(sender);
      player.setHealth(0);
      player.getMinecraftPlayer().onDeath(DamageSource.generic);
      sender.sendMessageToPlayer("Ouch. That looks like it hurt.");
   }
}
TOP

Related Classes of com.sijobe.spc.command.Kill

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.