When I type in commands it shows the command

Discussion in 'Plugin Development' started by Vinnya124, Jan 3, 2015.

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

    Vinnya124

    Hi. I made a test plugin where if the player does /hi it will reply hi. For some reason in the chat it will say hi and under that it says /hi. It does this with some of my other plugins. It shows the command. I uploaded an image of this. I don't understand why this is happening. Does anyone?
     

    Attached Files:

  2. Offline

    Vinnya124

  3. Offline

    TGRHavoc

    The boolean returned by the "onCommand" method is the result of the command. True means that the command was successful whereas false means that the user didn't enter the command correctly (something like that). So, when you return false, Bukkit feels that it needs to tell the user how to use the command they tried to use.


    Edit: Also, you're instantly trying to cast the CommandSender object (sender) to a Player object. This will cause a error when you run the command, to avoid this just throw in an instance check.
     
    Konato_K likes this.
  4. Offline

    22vortex22

    You need to return true; once the command is sent.
     
    Konato_K likes this.
  5. Offline

    Vinnya124

    Thanks everybody!!!!
     
  6. Offline

    TGRHavoc

    Glad that you've managed to figure it out. Don't forget to mark the thread as "Solved".
     
Thread Status:
Not open for further replies.

Share This Page