TheNextLvlTheNextLvl

Command Registration

Completely remove or restore commands from the server

GitHub Edit on GitHub

Unregistering Commands

Unregistering a command allows you to completely remove commands from the server.
Unlike hiding, unregistered commands cannot be executed by anyone.

Commands

Unregister a Command

Usage: /command unregister <command>
Completely removes a command from the server.

Examples:

# Unregister specific commands
/command unregister op
/command unregister deop
/command unregister stop

# Unregister all commands (use with extreme caution!)
/command unregister "*"

# Unregister all bukkit namespaced commands
/command unregister "bukkit:*"

# Unregister all namespaced commands
/command unregister "*:*"

Using /command unregister "*" will remove ALL commands from the server, including /command itself.
For this reason the fallback command /commander:command is exempt from unregistering.
If you messed up, you can use /commander:command register "*" to restore all commands.

Register a Command

Usage: /command register <command>
Restores a previously unregistered command, making it available again.

Examples:

# Register specific commands
/command register op
/command register deop

# Register all unregistered commands
/command register "*"

# Register all bukkit namespaced commands
/command register "bukkit:*"

# Register all namespaced commands
/command register "*:*"

Use Cases

Security Hardening

Remove dangerous commands that should never be used:

/command unregister op
/command unregister deop
/command unregister stop
/command unregister reload

Temporary Disabling

Unregister commands temporarily during events or maintenance:

/command unregister tpa
/command unregister home
/command unregister warp
/command unregister plotmenu

Server-Specific Commands

Unregister commands that don't apply to your server type:

/command unregister gamemode
/command unregister heal
/command unregister fly

Configuration

Unregistered commands are stored in a JSON configuration file.
The file contains a simple array of command names that should be unregistered.

[
  "op",
  "deop",
  "stop",
  "reload"
]

Tips

  • Commands are unregistered without the / prefix in the configuration
  • Both the main command and aliases should be unregistered if desired
  • Use /command reload to reload the configuration if manually edited
  • Use /command save to ensure changes are persisted to disk
  • Consider using command hiding instead of unregistering if you still want administrators to use the command

Difference from Hiding

FeatureHideUnregister
Command executionStill possibleCompletely removed
Who can useAnyone who knows itNobody
Administrator accessYes (with bypass)No
Use caseClean UISecurity/Disabling

Last updated on