Solved Console can't use my commands.

Discussion in 'Plugin Development' started by brian109, Apr 5, 2015.

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


    I have recently started working on a plugin that would give server needed commands for day to day administration. But, for some reason I cannot execute the commands from console. I have checked for if statements that check for a player and there are none. Please DO NOT ask me this question: Why did you put all the commands in one class? This is only a "rough draft" and will not be like this when i publish it.


  2. Offline


    @brian109 Want to post code? We can't really do much to help you without it. Also, what's the question?
  3. you cannot execute the commands from the console, because you casted the CommandSender to a Player
    @brian109: The only working method is onCommand! Methods like onCommand1 are NOT working
  4. Offline


    You are casting CommandSender to Player, if you are executing command in console, you cannot cast it to Player.
  5. Offline


    @brian109 Just check if the CommandSender is an instanceof a Player, and if it is, then cast to a Player.
  6. Offline


    • You can't have multiple onCommand methods
    • You don't need to cast sender to player unless you specifically need to do something that can't be done by console
    • You're checking if args length is equal to 1, then healing the sender. I think you meant 0.
    • You don't need those logger messages, Bukkit does this already.
  7. Offline


  8. Offline


    Actually, console has permissions. It has all of them.
    mythbusterma likes this.
Thread Status:
Not open for further replies.

Share This Page