Advertisement
Guest User

Untitled

a guest
Jan 17th, 2017
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. public class Commandovermc {
  2. public Main plugin;
  3. public Commandovermc(Main plugin) {
  4. this.plugin = plugin;
  5. }
  6. public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
  7. if (cmd.getName().equalsIgnoreCase("overmc")) {
  8. if (sender instanceof Player) {
  9. Player p = (Player) sender;
  10. if (args.length == 0) {
  11. p.sendMessage("Usa /overmc help");
  12. } else if (args[0].equalsIgnoreCase("help")) {
  13. //ayudas al jugador
  14. } else if (args[0].equalsIgnoreCase("crafteo")) {
  15. p.sendMessage("Crafteos items epicos");
  16. //abres un menu
  17. } else {
  18. p.sendMessage("No existe el argumento" + args[0] + ", usa /overmc help");
  19. }
  20. }
  21. }
  22. return false;
  23. }
  24. }
  25.  
  26.  
  27.  
  28. //Este tipo de comando no hace falta tenerlos en una sola clase, usando este método lo puedes meter directamente en la instancia y usar varios checks desde ahí ;)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement