Solved Just showing usage

Discussion in 'Plugin Development' started by xelatercero, Sep 26, 2017.

Thread Status:
Not open for further replies.
  1. Offline

    xelatercero

    I stopped doing plugins for 6 monts and now i have a problem and i dont see where is my error, this code is just returning the usage:

    PHP:
    public class tpgive implements CommandExecutor {
        
    Main plugin;
         public 
    tpgive(Main instance) {
        
    plugin instance;
        }

        @
    Override
        
    public boolean onCommand(CommandSender senderCommand cmdString labelString[] args) {
            if(
    cmd.getName().equalsIgnoreCase("tpbook")) {
                if(
    sender instanceof Player) {
                    
    Player player = (Playersender;
                    if(
    player.hasPermission("etb.give")) {
                        
    player.getInventory().addItem(plugin.tpBook());
                        return 
    true;
                    } else {
                        
    player.sendMessage(ChatColor.RED "You don't haver permission to do this!");
                        return 
    true;
                    }
                  
                }
            }
          
          
            return 
    true;
        }

    }



    EDIT: I am just stupid i didnt add the command to my registerCommands funcion, sorry
     
Thread Status:
Not open for further replies.

Share This Page