Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Commandovermc {
- public Main plugin;
- public Commandovermc(Main plugin) {
- this.plugin = plugin;
- }
- public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
- if (cmd.getName().equalsIgnoreCase("overmc")) {
- if (sender instanceof Player) {
- Player p = (Player) sender;
- if (args.length == 0) {
- p.sendMessage("Usa /overmc help");
- } else if (args[0].equalsIgnoreCase("help")) {
- //ayudas al jugador
- } else if (args[0].equalsIgnoreCase("crafteo")) {
- p.sendMessage("Crafteos items epicos");
- //abres un menu
- } else {
- p.sendMessage("No existe el argumento" + args[0] + ", usa /overmc help");
- }
- }
- }
- return false;
- }
- }
- //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