Advertisement
ottovolante321

Plugin Main

Jan 4th, 2015
245
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.35 KB | None | 0 0
  1. package me.ottovolante321.MyPlugin; //ottovolante321 isn't my username
  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 Eight extends JavaPlugin {
  13.         public final Logger logger = Logger.getLogger("Minecraft");
  14.         public static Eight plugin;
  15.         PluginDescriptionFile pdfFile = this.getDescription();
  16.        
  17.         @Override
  18.         public void onEnable() {
  19.                 this.logger.info(pdfFile.getName() + pdfFile.getVersion() +" has been enabled");
  20.         }
  21.        
  22.         @Override
  23.         public void onDisable() {
  24.                 this.logger.info(pdfFile.getName() + pdfFile.getVersion() +" has been desabled");
  25.         }
  26.        
  27.         public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args) {
  28.                 Player player = (Player) sender;
  29.                
  30.                 if(cmd.getName().equalsIgnoreCase("eight")) {
  31.                         player.sendMessage(ChatColor.GREEN + "The server is currently running " +  ChatColor .YELLOW + pdfFile.getName() + pdfFile.getVersion() + ".");
  32.                 }
  33.                 return false;
  34.         }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement