Guest User

Untitled

a guest
Apr 20th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. package me.iispaze.hello;
  2.  
  3. import org.bukkit.ChatColor;
  4. import org.bukkit.command.Command;
  5. import org.bukkit.command.CommandExecutor;
  6. import org.bukkit.command.CommandSender;
  7. import org.bukkit.entity.Player;
  8. import org.bukkit.plugin.java.JavaPlugin;
  9.  
  10. public class Main extends JavaPlugin implements CommandExecutor {
  11.  
  12. public void onEnable() {
  13. getCommand("hello").setExecutor(this);
  14. }
  15.  
  16. public String color(String string) {
  17. return ChatColor.translateAlternateColorCodes('&', string);
  18. }
  19.  
  20. @Override
  21. public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
  22. if(!(sender instanceof Player)) return false;
  23. Player player = (Player) sender;
  24.  
  25. player.sendMessage(color("&e&lSERVER &8» &7Hello there"));
  26. return true;
  27. /*
  28. * True = The command worked
  29. * False = The command had a error
  30. */
  31. }
  32. }
Add Comment
Please, Sign In to add comment