[MISC] PlgDisableCmd v2.0 - disable given commands [1.4]

Discussion in 'Archived: Plugin Releases' started by Plague, Feb 28, 2011.

  1. Offline


    PlgDisableCmd - Disable given commands
    Version: v2.0

    Since there was some demand to disable some commands without the use of permissions, I come to the rescue :)
    Just create a file "plugins/PlgDisableCmd/disabled.txt" and put commands (without the / character) you want to disable there on separate lines. That's it!

    Can disable any command, including hardcoded bukkit /help and /plugins or minecraft /give.

    Download (source code in the .jar)
    Download OP version (OPs can still use those commands)


    Version 2.0
    • updated to new bukkit API
    Version 1.3
    • More aggressive code, should truly block all commands, even for plugins not respecting the right way to handle commands.
    Version 1.2
    • Craftbukkit 600 compatibility
    Version 1.1
    • Fixed a bug - plugin was not case-insensitive
    Version 1.0
    • Initial release
  2. Offline


    That would men using my own permission system, I'd rather use Permissions plugin in that case, but my plugins use only OP on purpose, they are not really suited for larger servers.
  3. Offline


    REQ: Please add a /plgdisable reload or something :D
  4. Please add Permission-Nodes. That would be very nice :)
  5. Offline


    /reload works with this plugin
    nope, never
  6. Offline


    this was what I needed...works fine...thank you! :)
  7. Why not? If you don't like Permissions please add a config where I can configure the disallowed players
  8. Offline


    Becuase my plugins are for people not using permissions.
    And as for the config file, I'm just too lazy to invest time into it.
  9. Offline


    would be nice for a exception type of thing, i want to disable /give to all ops besides me.
  10. Offline


    Im assuming this is no longer needed with the new aliasing/disabling features in CB 928, within bukkit.yml?
    Or am I wrong.
    Just asking for information.
    ps: If this is a no-more now, I thank you for supporting this plugin as long as you have and developing it :) It came very useful!
  11. Offline


    Actually I did not have much time lately, so I only registered that there were changes to alias system, but did not read what it really does.
    I think you can create aliases, but am not sure that you can actually remove them.
  12. Offline


    Yes it says you can disable commands with it, buy using it and making output []
    something like that.
  13. Offline


    Looks like it according to the release notes.

    If someone tested it that for me, that would be great, I'd then change the main post...
  14. Offline


    I will as soon as I get an update for permissions 315b since it broke with 911+
    Unless hmm i use my test machine, lemme see

    Okay confirming the new bukkit way does work.
        username: bukkit
        isolation: SERIALIZABLE
        driver: org.sqlite.JDBC
        password: walrus
        url: jdbc:sqlite:{DIR}{NAME}.db
        update-folder: update
        spawn-radius: 16
        plugins: []
    Succesfully disables /plugins command
    However, now OPs cannot use it either. Therefore, I think i shall continue using your plugin, for the OP version :)

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: May 10, 2016
  15. Offline


    okay thanks @andrewkm , will keep this updated
  16. Offline


    @andrewkm thanks, that's a pretty good testing right there.
  17. The aliases tip doesn't work for me, not for builtin commands like kick/ban and ban-ip and pardon.
    But PlgDisableCmd successfully block them.

    A question, How i do to block commands with arguments?
    For example: /axr test <world>

    tried with only "axr" in the disabled.txt file, wont work. Even axr *, axr test * wont work. Any ideas?
    Also ommands containing spaces, like /axr on and /axr off wont block either.
  18. Offline


    Yes, the aliases system is for bukkit, those are MC commands that work differently.
    This plugin can only block the whole command, like "axr" and doesn't care about arguments.
    the "axr" only should work. I just tested it with "/time night" and it works. So I think it's the plugin that gives you the axr command, it can be written in a way that get around my plugin

    The only thing that you can try is to make sure my plugin is loaded before the one you want to block. On windows it works by renaming it to aaaPlgDisableCmd.jar AFAIK on Linux it's somewhat comples I think I use the remove, copy garbage, copy back method.
  19. I tried this.

    It works with the a-z method even on linux, in regards of load sequencing, since I named plgdisablemod with a in the beginngng and Antixray with z in the beginning.
    But it still not works to disable commands.

    Here is my console:
    >root@sebastian-G31M-ES2C:/minecraftserver# java -Xincgc -jar craftbukkit-0.0.1-NAPSHOT.jar
    151 recipes
    16 achievements
    15:14:37 [INFO] Starting minecraft server version Beta 1.7.3
    15:14:37 [VARNING] **** NOT ENOUGH RAM!
    15:14:37 [VARNING] To start the server with more ram, launch it as "java -Xmx1024M -Xms1024M -jar minecraft_server.jar"
    15:14:37 [INFO] Loading properties
    15:14:37 [INFO] Starting Minecraft server on *:25565
    15:14:37 [VARNING] The server will make no attempt to authenticate usernames. Beware.
    15:14:37 [VARNING] While this makes the game possible to play without internet access, it also opens up the ability for hackers to connect with any username they choose.
    15:14:37 [VARNING] To change this, set "online-mode" to "true" in the server.settings file.
    15:14:37 [INFO] This server is running Craftbukkit version git-Bukkit-0.0.0-920-g82c1a3d-b974jnks (MC: 1.7.3)
    15:14:37 [INFO] Preparing level "world"
    15:14:38 [INFO] Preparing start region for level 0 (Seed: 7675234116820103186)
    15:14:39 [INFO] Preparing spawn area: 73%
    15:14:39 [INFO] NSCommand 0.2 enabled.
    15:14:39 [INFO] [AdminIP] Enabled.
    15:14:39 [INFO] AntiHack version 2.0 is enabled without permissions!
    15:14:39 [INFO] PlgDisableCmd version 1.3 is enabled!
    15:14:39 [INFO] Disabled 10 commands
    15:14:39 [INFO] Permission system not detected, defaulting to OP
    15:14:39 [INFO] [ARG] Checking/loading files...
    15:14:39 [INFO] [ARG] Loaded 4 items from Regions.txt
    15:14:39 [INFO] [ARG] Loaded 2 items from FriendsList.txt
    15:14:39 [INFO] [ARG] Loaded 5 items from LastOnline.txt
    15:14:39 [INFO] [ARG] Scheduling tasks...
    15:14:39 [INFO] AutoRegionGuard version 0.5 is enabled!
    15:14:39 [INFO] NoSuffixedKill has been enabled.
    15:14:39 [INFO] AntiXRay version 0.6.10: Permissions not detected. Ops only
    15:14:39 [INFO] AXR: Loading/Scanning Chunks
    15:14:39 [INFO] repack
    15:14:40 [INFO] 0/625 chunks loaded
    15:14:40 [INFO] 512/625 chunks loaded
    15:14:40 [INFO] AXR: hidden:143237 ores in 625 chunks 0.6993994140625%
    15:14:40 [INFO] AntiXRay 0.6.10 enabled.
    15:14:40 [INFO] Done (0,254s)! For help, type "help" or "?"
    15:15:12 [INFO] sebnie [/] logged in with entity id 166 at ([world] -272.625, 64.0, -27.40625)
    15:15:12 [INFO] [AdminIP] Opping <sebnie> from IP <>.
    15:15:12 [INFO] Opping sebnie
    15:15:12 [INFO] AdminIP: Opping sebnie
    15:15:29 [INFO] CMD_axr_off[CraftPlayer{name=sebnie}]
    15:15:32 [INFO] CMD_axr_on[CraftPlayer{name=sebnie}]
    15:15:36 [VARNING] Can't keep up! Did the system time change, or is the server overloaded?
    15:16:57 [INFO] Connection reset
    15:16:57 [INFO] sebnie lost connection: disconnect.quitting
    15:16:57 [INFO] De-opping sebnie
    15:16:57 [INFO] AdminIP: De-opping sebnie
    15:16:57 [INFO] [AdminIP] Deopping <sebnie> from IP <>.

    As you can see, plgDisableCmd is loading before AntiXray, its still possible to run /axr off and /axr on even when them are disabled.
    Here is my disabled.txt:

    These mods are running: PlgDisableCmd, AdminIP,AntiHack, AntiXray, AutoRegionGuard, NoSuffixedKill, NsCommand (required for AntiXray)
  20. Offline


    So, I just tested both OP and non-OP versions of my plugin against AntiXRay 0.6.10 and NSCommand 0.2.
    Worked as it should. You can also see that it works even by testing /axr with no parameter since when blocked it should print nothing, but when not blocked it prints "unknown command" message by bukkit.

    Try only PlgDisableCmd and AntiXray+NSCommand, if that works.
    Also try having only axr in the disabled.txt. But you say that other commands works, so I'm really stumped now. Also remove all aliases done in bukkit.yml or such...
  21. Now I solved it. Seems like NSCommand is doing the commands for axr. When I putted z infront of NSCommand so it loads after PlgDisableCmd, it works now, finally.
  22. Offline


    makes sense, well at least i am now 100% confident that moving the order should help everyone having these problems.
  23. Offline


    Dude your Plg plugins are so awesome, this is jsut an idea but is it possible you make like a command that give non ops commands that ops can do, like you get a config.txt that you put op commands in and then non ops will get that command? If you know what I mean... Just though it would be an awesome idea! P.S Love your plugins! [meat]
  24. Offline


    that's what permissions and other more complex plugins are fore, this is just a real simple one.
  25. Offline


    I know that but permissions is too much effort, i mean just something simple to assign one plugin to one player because i don't want to make ranks and get all the permission node's and stuff just to give one player a command, thats what i mean.
  26. Offline


    This is so awesome! Thanks a lot, now my friends who ask for OP won't be able to give themselves items. (I'm too nice to say no to their requests) :)
  27. Offline


    Trying to block a /kill command, however this command is a little tricky since you can type anything after /kill and it will still work and not be blocked.

    For example. /killafsdasdas would kill you

    Is there a way to "Blanket" deny a command like /kill*?

  28. Offline


    Wow did Notch really program it THAT way? Lame, really. I don't support escape characters, maybe I could do something like "*kill" so when you start with an asterisk I could use another compare fucntion. Will look into it when I have time, but I have a project to finish first.
  29. Offline


    It appears he did :/.

    Great, Thanks for the quick response.
  30. Offline


    COuld you make this world different per different world?:D
  31. Offline


    Don't really get what you want.

Share This Page