Guest User

Untitled

a guest
Jul 16th, 2018
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.30 KB | None | 0 0
  1. package me.stupinator.youtube;
  2.  
  3. import java.util.logging.Logger;
  4.  
  5. import org.bukkit.ChatColor;
  6. import org.bukkit.command.Command;
  7. import org.bukkit.command.CommandSender;
  8. import org.bukkit.entity.Player;
  9. import org.bukkit.plugin.PluginDescriptionFile;
  10. import org.bukkit.plugin.java.JavaPlugin;
  11.  
  12. public class Youtube extends JavaPlugin{
  13.    
  14.     public final Logger logger= Logger.getLogger("Minecraft");
  15.     public static Youtube plugin;
  16.    
  17.     public void onDisable(){
  18.         PluginDescriptionFile pdfFile = this.getDescription();
  19.         this.logger.info(pdfFile.getName()+ "is Disabled.");
  20.     }
  21.     public void onEnable(){
  22.         PluginDescriptionFile pdfFile = this.getDescription();
  23.         this.logger.info(pdfFile.getName() + " Version"+ pdfFile.getVersion()+ " is Enabled.");
  24.        
  25.     }
  26.    
  27.     public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args){
  28.         Player player = (Player) sender;
  29.        
  30.         if(commandLabel.equalsIgnoreCase("heal") || commandLabel.equalsIgnoreCase("h")){
  31.             if(args.length == 0){
  32.                 player.setHealth(20);
  33.                 player.sendMessage(ChatColor.GREEN+"Healed!");
  34.             }else if(args.length == 1){
  35.                 Player targetPlayer = player.getServer().getPlayer(args [0]);
  36.                 targetPlayer.setHealth(20);
  37.                 player.sendMessage(ChatColor.GREEN+"Healed!");
  38.             }
  39.         }
  40.        
  41.         return false;
  42.     }
  43.    
  44. }
Add Comment
Please, Sign In to add comment