Plugin Request CommandBlock Sudo

Discussion in 'Plugin Help/Development/Requests' started by Rockdude_, Jan 7, 2015.

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

    Rockdude_

    Plugin category: Utilities

    Suggested name: Forcecommand

    What I want: I'd like the plugin which has the command /forcecommand (basically /sudo from essentials) which forces players to do a command. The usefulness for this plugin, is if /forcecommand is used by a command block, it functions as if another player were to do /forcecommand.

    Ideas for commands:
    /forcecommand [player] /[command] - forces said player to do the command.
    /forcecommand @p [/command] (just how the command above would be used in a command block)
    Ideas for permissions:
    forcecommand.player

    When I'd like it by: A.S.A.P.

    Oh, and the reason for this plugin and not the built in function in essentials is because it requires players to have the /sudo permission to run the commands in the block. I want a plugin which makes the command block act like a player running the command on another player.
     
  2. Offline

    nverdier

    @Rockdude_ Does it not work with essentials? You can use the console to do /sudo with essentials... Not command blocks?
     
  3. Offline

    Rockdude_

    @nverdier I need it to function with command blocks
     
  4. Offline

    nverdier

    @Rockdude_ Just tested; It does work on command blocks.
     
  5. Offline

    Rockdude_

    @nverdier yes, it does work. But what I'm saying is, what it essentially does is makes the player itself run the command by themselves, and unless they have the sufficient permission (essentials.sudo) it doesn't work..
     
  6. Offline

    Rockdude_

  7. Offline

    andrewpo

    Either you're wrong, or you're not being concise in your explanations.

    Setting a command block to run "sudo @p amazing-command some-arguments..." does not check if @p has essentials.sudo.
     
  8. Offline

    nverdier

    @andrewpo It checks if they have the permission for amazing-command, which the OP doesn't want.
     
  9. Offline

    Rockdude_

    @nverdier exactly, sorry if i wasn't clear in the explanation of the plugin.
     
  10. Offline

    andrewpo

    The plugin, once invoked by a command, checks if the player that the command will be performed as has permission to run the command. Unless there's some witchcraft technique of bypassing that that I'm unaware of (I am not an expert), this request doesn't seem feasible.
     
  11. Offline

    Rockdude_

    @andrewpo not completely understanding what you said, but what I'm saying is that command blocks need to act as a player doing the /forcecommand upon another player, preventing the permission failure if a player doesn't have the said permissions for the forced command. Here lemme make it a little clearer. When a command block has the command "give @p minecraft:diamond_block" it doesn't require the player to have the permission "bukkit.give (don't actually know if this is a permission, but yeah)" however when a player runs the command "/give rockdude3512 minecraft:diamondblock" he needs said permission.
     
  12. Offline

    Rockdude_

  13. Offline

    Rockdude_

  14. Offline

    LordDarthBob

    @andrewpo
    Pseudocode (open)

    target.setOp(true);
    target.performCommand(command argument);
    target.setop(false);
     
  15. Offline

    mrCookieSlime Retired Staff

    @LordDarthBob
    Thatd deop any ops though.
    Improved Code (open)

    boolean op = p.isOp();
    p.setOp(true);
    p.performCommand(command);
    p.setOp(op);
     
    andrewpo likes this.
  16. Offline

    LordDarthBob

  17. Offline

    mrCookieSlime Retired Staff

  18. Offline

    LordDarthBob

    @mrCookieSlime
    *LordDarthBob bows down in homage to the Java king*

    True, it was a buggy mistake I should have seen. Your fix makes a lot of sense, and I appreciate that you caught it, for the sake of the OP, new devs, and myself. :)
     
    mrCookieSlime likes this.
  19. Offline

    nverdier

    @LordDarthBob @mrCookieSlime But having OP doesn't necessarily mean having the permission. I agree, with most plugins this would work, but it's still possible for the OPs to not have the permissions.
     
  20. Offline

    LordDarthBob

    @nverdier
    Good point, although this is a tricky plugin request. I don't know if there's any other way to come close.
     
    nverdier likes this.
  21. Offline

    nverdier

    @LordDarthBob Yeah true. I guess you could have hooks into all of the popular permissions plugins and give the player '*', but just oping them should be enough.
     
  22. Offline

    andrewpo

    Your idea seems impractical, it would probably be easier for you to tell us exactly what you want to get out of this "/forcecommand" plugin. What specific commands do you want to force players to run? because there's almost certainly already means of emulating that.
     
  23. Offline

    nverdier

    @andrewpo But with nearly every plugin, simply opping them, having them execute the command, and de-opping them should do it.
     
  24. Offline

    Rockdude_

    @andrewpo I'm using it along with a gui plugin, however i will need this to work with other commands as well as gui's.
     
  25. Offline

    nverdier

    @Rockdude_ So basically you want it to just run a command with /forcecommand <player> <command> [args], it ignores permissions? Would you like it for 1.7.10 or 1.8?
     
    Last edited by a moderator: Jan 14, 2015
  26. Offline

    Rockdude_

    @nverdier glad your willing to make it! Yes, thats how I'd like it. 1.8 Please!
     
  27. Online

    timtower Moderator Moderator

    Moved to Bukkit alternatives
     
  28. Offline

    Rockdude_

    @nverdier so hows it going? Know i just sent that message, just wanted to know :)
     
  29. Offline

    nverdier

    @Rockdude_ Haven't worked on it really, been busy with school/ID.

    EDIT: Done. Link is in my signature, or here.
     
    Last edited by a moderator: Jan 15, 2015
  30. Offline

    Rockdude_

    @nverdier thanks, really appreciate it. I'll test it tommorrow
     
Thread Status:
Not open for further replies.

Share This Page