Solved Repeating the command in chat?

Discussion in 'Plugin Development' started by AdamDev, Aug 11, 2017.

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

    AdamDev

    This isnt really plugin development but this happens everytime I do a command. For say, if you do /command, in chat it will repeat what you just said: /command.

    Is there a way of removing this or stop it from happening?

    Thanks
    ~AdamDev
     
  2. Offline

    Zombie_Striker

    @AdamDev
    You are most likely returning false in the command. What you are returning is if the server needs to send the usage of the command. If the command worked as it should, and you do not need to correct the player on how they need to send the command, return true. Only return false when they need that message.
     
  3. Offline

    AdamDev

    @Zombie_Striker
    So, ive been doing it all wrong xD. I've always been putting false but thanks btw. Just got to change everything to true.

    Edit: Is there a way of changing this message by using variable or no. So, if he player does it wrong it would return a string, is that possible?
     
  4. Offline

    Zombie_Striker

    @AdamDev
    If you only want one message for the command (i.e, if you do not care about the args used), then define the usage in the plugin.yml (by adding the "usage:" tag under the command's description). If you need there to be a new message for each arg provided (i.e, if you use sub commands), then you will have to create your own system for the messages and return true.
     
  5. Offline

    AdamDev

    So that means I have to do:
    Code:
    test:
       description: blah
       usage: Error, wrong
    ?
    Edit: And is there a way of changing the message's color?
     
  6. Offline

    Zombie_Striker

    @AdamDev
    Yes, that should be fine.

    To change the color, you will need to use the default color characters (such as &1 )
     
  7. Offline

    AdamDev

    Thanks! I'll test it later for now I'll mark it as solved!
     
Thread Status:
Not open for further replies.

Share This Page