Hiding commands!

Discussion in 'Plugin Development' started by castletaker11, Nov 15, 2013.

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

    castletaker11

    So, i'm trying to make a plugin where certain commands are hidden from /help.
    I'm trying to make this because firstly i'm a beginner coder and want to learn more (so please don't send links for any plugins like this).
    And secondly, i want it so that when someone reads the rules there is a hidden word which you type and you are ranked up or tpeed to the real spawn.
    Please help me with how to make a command hidden from /help :D
     
  2. Offline

    Garris0n

    You can't. You could use the PlayerCommandPreprocessEvent to make a nonexistent command, I suppose, but that's generally frowned upon.
     
  3. Offline

    1Rogue

    Fairly certain /help's output was permissions based (or at least used to be).
     
  4. Offline

    Garris0n

    It is, actually, however that will prevent the player from being able to use the command. I remember trying to implement permissions in one of my custom plugins to prevent people from tab-completing them, however it automatically denied them using the commands with the "...please contact an administrator if you believe this is an error." message, and I wanted to use a custom no permission message. Pretty annoying. I can't wait till I bother to make my own fork of craftbukkit...
     
  5. Offline

    1Rogue


    You get that message when attaching a permission to a command in the plugin.yml. Alternatively you can add a "permission-message" key to that command if you want a custom output.
     
  6. Offline

    Garris0n

    I totally failed to notice that, thanks. Either way, as far as the OP goes, if you attach a permission to remove it from /help, the player won't be able to use the command afaik. Seems like the only way is to use the hacky preprocess event unless I'm missing something.
     
  7. Offline

    1Rogue


    You can add the commands dynamically with reflection, and then they don't show up.
     
  8. Offline

    Garris0n

    Seems about as hacky as just using the preprocess event at that point though. Also I don't think a "beginner coder" should be trying to register commands through reflection, that's just asking for trouble...
     
  9. Offline

    castletaker11

    Sorry I haven't responded recently, that is because Bukkit wouldn't let me post replies for some reason? Thanks for all you help guys!
     
Thread Status:
Not open for further replies.

Share This Page