Advertisement
Guest User

Untitled

a guest
Mar 7th, 2015
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. package me.MrTimmeyyy.test;
  2.  
  3.  
  4.  
  5.  
  6. import org.bukkit.Bukkit;
  7.  
  8.  
  9.  
  10.  
  11. import org.bukkit.ChatColor;
  12.  
  13.  
  14.  
  15.  
  16. import org.bukkit.command.Command;
  17.  
  18.  
  19.  
  20.  
  21. import org.bukkit.command.CommandSender;
  22.  
  23.  
  24.  
  25.  
  26. import org.bukkit.entity.Player;
  27.  
  28.  
  29.  
  30.  
  31. import org.bukkit.plugin.java.JavaPlugin;
  32.  
  33.  
  34.  
  35.  
  36. publicclass test extends JavaPlugin {
  37.  
  38.  
  39.  
  40.  
  41. publicvoid onEnable() {
  42.  
  43. Bukkit.getServer().getLogger().info("Test Plugin Enabled!");
  44.  
  45. }
  46.  
  47. publicvoid onDisable() {
  48.  
  49. Bukkit.getServer().getLogger().info("Test Plugin Disabled!");
  50.  
  51. }
  52.  
  53. publicboolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args) {
  54.  
  55.  
  56.  
  57.  
  58. if (!(senderinstanceof Player)) {
  59.  
  60. sender.sendMessage(ChatColor.AQUA + "The console ran the test command! Good job!");
  61.  
  62. returntrue;
  63.  
  64. }
  65.  
  66. Player player = (Player) sender;
  67.  
  68.  
  69.  
  70.  
  71. if (cmd.getName().equalsIgnoreCase("test")) {
  72.  
  73. player.sendMessage(ChatColor.GOLD + "You ran the test command! Good job!");
  74.  
  75. }
  76.  
  77. returntrue;
  78.  
  79. }
  80.  
  81. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement