Solved force a command in a plugin *HELP*

Discussion in 'Bukkit Help' started by heroboy04, Jul 18, 2014.

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

    heroboy04

    My problem here is that : Is there a way that I can force a command threw a permission maybe or what ever in a plugin that can't do any command while you using this plugin ?

    here is what's happening : I am using plugin ( DynamicAliases ) so that I can use the command /hub in every mini-game for leaving it . But for now I have this plugin ( Quicksand ) like tntrun ! and I put the ( qs leave ) in the plugin ( DynamicAliases ) so it should out of the game when I write /hub but the QS plugin don't even let me use the ( DynamicAliases ) plugin to do that !

    so is there any thing that I can use for force that command ? but I don't mean just for that plugin 'cause I am sure that it's not the only plugin that will do that !

    So is there maybe a plugin that could solve the problem ?
     
  2. Offline

    LHammonds

    Can you just use the built-in commands.yml?

    You could make a "hub" alias that issues all the commands you want before actually doing the teleport.

    That would be a broad shotgun approach though so it would be issuing "/qs leave" for players not even playing that game.

    LHammonds
     
  3. Offline

    heroboy04

    built-in commands.yml? ... I didn't understand !
    and the second line : ?? ! ?

    And about the messages that come to the players ! I am using the plugin ( MessageFilter ) for hide these messages if the are not playing it !
     
  4. Offline

    LHammonds

    commands.yml
     
  5. Offline

    heroboy04

    LHammonds Oh I understand what you mean but ! it's the same thing and whit the plugin that i told you about I can edit what command come first but and I put this command for leaving first but , with the plugin or with the commands that you meant it's the same it tells me that I must leave the game !
     
  6. Offline

    heroboy04

    Anyone ? :D ...
     
  7. Offline

    daavko

    heroboy04 Looks like Quicksand is listening to PlayerCommandPreprocessEvent and if message doesn't equal "/qs leave", cancels it. If I'm right and it is really done this way, you can't alias that command to /hub.

    EDIT: Just looked into Quicksand' source code and saw I was right. It cancels any command, which doesn't start with /qs.
     
  8. Offline

    heroboy04

    so .. ! should I close this thread ?
     
  9. Offline

    daavko

    heroboy04 Yes, because there is no way to alias that command to /hub without rewriting Quicksand. Also, you can request a feature to dev of Quicksand: "Please add list of commands which won't be blocked while playing" and that might solve your problem when new version comes out (only if that dev adds this feature, though...)

    But wait! Little twist. If you look into that source closely, you can see he only added EventHandler without priority. And as Bukkit Wiki states, EventHandler without priority listens at EventPriority.NORMAL. So, you could make a simple plugin, which listens at EventPriority.HIGHEST and un-cancels the event, if command is "/hub".

    EDIT: So yes, there is a solution to your problem, which will work until EventHandler of Quicksand' listener changes priority to highest.
     
  10. Offline

    heroboy04

    daavko
    ... Idk anything about create a plugin ! even if it's simple ! :D
    so I think I close the thread ! and i will just ask the dev for it :)
    thx anyway !:)
     
  11. Offline

    daavko

Thread Status:
Not open for further replies.

Share This Page