Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package me.Ben.BenjaminCommand;
- import java.util.logging.Logger;
- import org.bukkit.Bukkit;
- import org.bukkit.ChatColor;
- import org.bukkit.GameMode;
- import org.bukkit.Location;
- import org.bukkit.World;
- import org.bukkit.command.Command;
- import org.bukkit.command.CommandSender;
- import org.bukkit.entity.Player;
- import org.bukkit.plugin.PluginDescriptionFile;
- import org.bukkit.plugin.java.JavaPlugin;
- public class BenjaminCommand extends JavaPlugin {
- public final Logger logger = Logger.getLogger("Minecraft");
- public static BenjaminCommand plugin;
- @Override
- public void onDisable() {
- PluginDescriptionFile pdffile = this.getDescription();
- this.logger.info(pdffile.getName() + " Has Been Disabled");
- }
- @Override
- public void onEnable() {
- PluginDescriptionFile pdffile = this.getDescription();
- this.logger.info(pdffile.getName() + " Version " + pdffile.getVersion() + " Has Been Enabled! ");
- }
- public boolean onCommand(CommandSender sender, Command command, String commandLabel, String[] args)
- {
- Player player = (Player)sender;
- if(commandLabel.equalsIgnoreCase("suicide")){
- player.setHealth(0);
- }else if(commandLabel.equalsIgnoreCase("thor")){
- player.getWorld().strikeLightning(player.getLocation());
- player.getServer().broadcastMessage(player.getDisplayName() + " Has Been Struck By Lightning");
- }else if(commandLabel.equalsIgnoreCase("benjamin")){
- player.getServer().broadcastMessage("Benjamin Command Is Working!");
- }else if(commandLabel.equalsIgnoreCase("ragequit")){
- player.kickPlayer("RageQuit!");
- player.getServer().broadcastMessage(player.getDisplayName() + " Has rage quited");
- }else if(commandLabel.equalsIgnoreCase("benport"));
- if(args.length == 1){
- Player targetPlayer = player.getServer().getPlayer(args[0]);
- Location TargetPlayerLocation = targetPlayer.getLocation();
- player.teleport(TargetPlayerLocation);
- }else if(args.length == 2){
- Player targetPlayer = player.getServer().getPlayer(args[1]);
- Player targetPlayer1 = player.getServer().getPlayer(args[2]);
- Location targetPlayer1Location = targetPlayer1.getLocation();
- targetPlayer.teleport(targetPlayer1Location);
- }
- return true;
- }
- }
Add Comment
Please, Sign In to add comment