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

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

  1. Offline

    Plague

    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!

    Features:
    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)

    [​IMG]


    Changelog:
    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. Just tested it. I found it to disable /spawn, but it did not disable WorldEdit's /butcher command (kill all mobs).
     
  3. Offline

    Plague

    Well this is primarily aimed ad plugins not using permissions or their own settings. But as I use preprocess event I don't see how the command can even reach other plugins that use onCommand (which by lookind at current (4.0) worldedit it does.

    Do you by any chance have an older worldedit?

    Edit: no I cannot make it any better, since I do use the highest priority possible.
     
  4. No, I am using the most recent update. I try to make sure that all of my plugins are the most recent version, as well as my CraftBukkit (which is actually build 472).
     
  5. Offline

    MacVaultDweller

    I think you are on the right track with this plugin. Permissions plugins are a big pain in the *** and break everything every time they are updated or abandoned. Just another weak link in a rusty chain. Until a permissions system is written in stone I try to stay away from any mod that requires someone else's plugin to run. I often encourage makers of mods that do use permissions to make it so that their mod will default to op-list for implementation. Mod creators that put in a default to op list soon find out that they aren't harassed by admin.'s and their players when changes take place because limited functionality remains and is in the hands of trusted administrators.
     
    Plague likes this.
  6. Offline

    5*stunner

    I could use some help. no default files are created when i start my server.
     
  7. Offline

    jcgamo88

    I'm unable to get this plugin to work. Added /give and a few commands from other plugins I don't like. All of them still work as if nothing was changed.

    Tried /time and /give, both worked without fail :(

    The following is my disabled.txt file:
    Code:
    nick
    kit
    give
    superpickaxe
    item
    heal
    god
    antioch
    i
    bigtree
    tree
    kill
    nuble
    time
    persist
    jump
    top
    spawnmob
    tp
    teleport
    back
    tptoggle
    tele
    tpa
    tpo
    tpahere
    s
    tphere
    tpohere
    tppos
     
  8. Offline

    Plague

    No they're not, create plugins/PlgDisableCmd directory and disabled.txt inside

    Well I really only meant it to use against original bukkit commands, which has been thoroughly tested. I also tested it against my plugins that have /time and stuff and it also worked. So maybe your plugins use some other command interface than onCommand :(
    I could test it if you tell me which plugin, but if it needs permissions or groups I'm not gonna configure that. But permissions and groups can already disable commands, so that would be for nothing anyway.
     
  9. Offline

    jcgamo88

    Unfortunately I was/am using Essentials core. To my understanding it takes over the /give command from bukkit, and also implements the /time and other commands. Essentials does have a built in option to disable some commands but it doesn't support blocking other plugin commands I don't believe, which is why I came to find your plugin.
    I actually took the time to setup permissions last night though instead of looking for an easy way out. Though I'll be more than happy to provide any info that might help you expand your plugin should you want to do so.
     
  10. Offline

    Plague

    Yes, I meant it like that, that essentials can disable their own commands, so if you use my plugin to disable some other commands (non-essentials ones) which are those and what plugin?
     
  11. Offline

    Bjourk

    Could I use this to fix this error with the Help plugin?
    Code:
    2011-03-16 20:45:14 [SEVERE] null
    org.bukkit.command.CommandException: Unhandled exception executing command 'help' in plugin Essentials v2.0.295
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:37)
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:80)
        at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:183)
        at net.minecraft.server.NetServerHandler.c(NetServerHandler.java:645)
        at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:608)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:602)
        at net.minecraft.server.Packet3Chat.a(SourceFile:24)
        at net.minecraft.server.NetworkManager.a(SourceFile:230)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:76)
        at net.minecraft.server.NetworkListenThread.a(SourceFile:100)
        at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:357)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:272)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:366)
    Caused by: org.bukkit.command.CommandException: Unhandled exception executing command 'help' in plugin Help v0.2
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:37)
        at com.earth2me.essentials.Essentials.onCommand(Essentials.java:543)
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:35)
        ... 12 more
    Caused by: java.lang.NullPointerException
        at me.taylorkelly.help.HelpPermissions.permission(HelpPermissions.java:43)
        at me.taylorkelly.help.HelpEntry.playerCanUse(HelpEntry.java:48)
        at me.taylorkelly.help.HelpList.getSortedHelp(HelpList.java:38)
        at me.taylorkelly.help.Lister.setPage(Lister.java:32)
        at me.taylorkelly.help.Help.onCommand(Help.java:77)
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:35)
        ... 14 more
    
     
  12. Offline

    Plague

    It should catch the /help and prevent it from executing, yes.
    But some plugins can get around this (I can't understand why exactly) so try that and report back please.
     
  13. Offline

    o0AzzA0o

    plague this plugin is working fine for me but some of the users are bypassing the blocks..... say i block spawn they just then do /SPAWN or /Spawn /sPAWn ... you get the idea anyhow i was wondering if you could make it non case sensitive.
     
  14. Offline

    Plague

    If you put it lowercase in the config it should work. Bukkit should send me lowercase commands no matter how the user wrote them...

    I'll test (and possibly update) it tomorrow, I'm not at my home computer right now.
     
  15. Offline

    Plague

    Wow, that was some bad testing on my side ;)
    Fixed now.
     
  16. Offline

    o0AzzA0o

    thanks for fixing that :)
     
  17. I had this working with my other folder, isn't booting up with my new folder. Is it out of date? Sorry for asking.
     
  18. Offline

    Plague

    Well bukkit changed a lot in the development builds, so unless you use the recommended one it may not work.
     
  19. Offline

    Lying_Cake

    I cannot get this command to work, and im trying to block the /give command. Ive tried several variations with no luck.... Thanks for any help!
    These are the variations i have tried:
    give
    Give
    /Give
    /give
    /Give (playername) (ID)
    /give (Playername) (ID)
     
  20. Offline

    Plague

    The first two are valid (just the name of the command on a separate line "give").
    I just tested it on CB # 556, disabling works. I tested the original minecraft /give command, not anything given by essentials or such, since those can disable them using permissions.
     
  21. In server console it says plgdisablecmd 1.1 loaded but it wont make the folder and txt doc.
    So I created a folder myself named PlgDisableCmd in plugins with a txt document and still nothing.

    So it must be something interfering. Any ideas on what it could be? ty.
    [​IMG]
     
  22. Offline

    Plague

    Well Commands Login, DefaultCommands and Scrapbukkit deal with commands, so you could try those.
     
  23. >.> My fault. Named the .txt the title of plugin. It needed to be:
    'disabled.txt.'

    Special thanks to jcgamo88's post:
     
  24. Offline

    Plague

    Updated to CB600, old version here.
     
  25. Is it possible to update this to support Permissions? I just want some of these commands to not be used by the players, but admins should be able to use them.
     
  26. Offline

    Plague

    This is a "replacement" for permissions. Can't Permissions disable commands?
     
  27. From what I've tried, permissions doesn't disable commands that is not a plugin. I'm trying to disable /pl and /version from users and allow admins to keep these commands. But these 2 commands are not part of a plugin and don't have permissions nodes.
     
  28. Offline

    zebras

    Plague it dosent work for me.. i use it on 670 build and used on 617 i added:

    /plugins
    /Plugins
    plugins
    Plugins


    But i could still use command /plugins
     
  29. Offline

    Plague

    Just tested on CB 670 and it works for me.
    added "plugins" to "plugins/PlgDisableCmd/disabled.txt" file
    when starting server, it reports: "[INFO] Disabled 1 commands"
     
  30. Offline

    zebras

    yes, it reports that it is blocking 1 commands but everybody still can use it..
     

Share This Page