Advertisement
Guest User

again

a guest
Mar 27th, 2017
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. package me.rubaiyat.test;
  2.  
  3. import org.bukkit.Bukkit;
  4. import org.bukkit.ChatColor;
  5. import org.bukkit.command.Command;
  6. import org.bukkit.command.CommandSender;
  7. import org.bukkit.plugin.java.JavaPlugin;
  8.  
  9. public class Test extends JavaPlugin {
  10. public void onEnable() {
  11. Bukkit.getServer().getLogger().info("Test Plugin Enabled!");
  12.  
  13. }
  14.  
  15. public void onDisable() {
  16. Bukkit.getServer().getLogger().info("Test Plugin Disabled!");
  17.  
  18. }
  19.  
  20. public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args) {
  21. if (!(sender instanceof Player)) {
  22. sender.sendMessage(ChatColor.AQUA + "The console ran the test command!");
  23. return true;
  24. }
  25.  
  26. Player player = (Player) sender;
  27.  
  28. if (cmd.getname().equalsIgnoreCase("test")) {
  29. player.sendMessage(ChatColor.GOLD + "You ran the test command successfully! Good Job");
  30. return true;
  31. }
  32.  
  33. }
  34.  
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement