CommandHelper

CommandHelper

46.5k Downloads

Event to commandblock or/and console commands

LadyCailinBot opened this issue ยท 3 comments

commented

CMDHELPER-2846 - Reported by Guy.Nice

Is there any way to get server_command event that runs every time commandblock/console runs command.
player_command seems to run only if real player runs commands.

Since i want to make whitelist to commandblock commands, now i can only make blacklist by making alias for every command i want to block.

Or even better: event that detects when command is written to commandblock, so i can cancel it or/and function that can change that command...if this is even possible.

commented

Comment by jb_aero

For the former, see the CHAdvanced extension.

For the latter, not possible without packet handling. Though if this is something you need to do, you must have ops that you don't trust. So why op them? Anyway, until CH has support for it, this might do what you need: http://dev.bukkit.org/bukkit-plugins/safe-command-block/

commented

Comment by PseudoKnight

register_command() picks up command blocks, but unfortunately get_command_block() doesn't work in that environment. (See http://youtrack.sk89q.com/issue/CMDHELPER-2838) However, if you don't need a block location, it works perfectly.

I ended up creating a basic plugin that allows me to set commandblocks. It'd be an easy addition to CH.

commented

Comment by PseudoKnight

I forgot to mention, because I thought you probably knew already, but you can use aliases in command blocks if you prefix the command with /runalias in the command block.