diff --git a/content/docs/commander/hide-reveal.mdx b/content/docs/commander/hide-reveal.mdx new file mode 100644 index 0000000..3c5da1f --- /dev/null +++ b/content/docs/commander/hide-reveal.mdx @@ -0,0 +1,103 @@ +--- +title: Command Visibility +description: Control command visibility in tab completion +--- + +# Hiding and Revealing Commands + +Hiding commands allows you to control which commands appear in tab completion, +creating a cleaner experience for players while still allowing the commands to be executed by those who know them. + +## Commands + +### Hide a Command + +Usage: `/command hide ` +Hides a command from tab completion. + +**Examples:** +``` +# Hide specific commands +/command hide plugins +/command hide pl + +# Hide all commands +/command hide "*" + +# Hide all bukkit namespaced commands +/command hide "bukkit:*" + +# Hide all namespaced commands +/command hide "*:*" +``` + + + Using `/command hide "*"` will hide literally **ALL** commands, including `/command` itself. + Use `/command reveal "*"` to quickly restore all hidden commands. + + +### Reveal a Command +Usage: `/command reveal ` +Makes a previously hidden command visible again in tab completions. + +**Examples:** +``` +# Reveal specific commands +/command reveal plugins +/command reveal pl + +# Reveal all hidden commands +/command reveal "*" + +# Reveal all bukkit namespaced commands +/command reveal "bukkit:*" + +# Reveal all namespaced commands +/command reveal "*:*" +``` + +## Bypass Permission +Players with the `commander.bypass` permission can see all hidden commands. + + + Wildcard permissions (like `*`) are ignored for the bypass permission. + Players must have the explicit `commander.bypass` permission to see hidden commands. + + +## Use Cases + +### Clean Command Lists +Hide administrative or utility commands that regular players shouldn't see: +``` +/command hide plugins +/command hide pl +/command hide version +/command hide ver +``` + +### Server-Specific Commands +Hide commands that are only relevant to certain server types or gamemodes. + +### Development Commands +Hide debugging or development commands from production environments. + +## Configuration + +Hidden commands are stored in a JSON configuration file. +The file contains a simple array of command names that should be hidden. + +`hidden-commands.json`: +```json +[ + "plugins", + "pl", + "version", + "ver" +] +``` + +## Tips + +- Commands are hidden without the `/` prefix in the configuration +- Both the full command name and aliases should be hidden if desired +- Use `/command reload` to reload the configuration if manually edited \ No newline at end of file diff --git a/content/docs/commander/index.mdx b/content/docs/commander/index.mdx index d5bc629..ec241ae 100644 --- a/content/docs/commander/index.mdx +++ b/content/docs/commander/index.mdx @@ -4,4 +4,123 @@ description: Manage command visibility and permissions icon: BookMarked --- -Coming soon! +# Commander + +Commander is a powerful Minecraft server plugin that gives you complete control over command visibility, +permissions, and registration. +Clean up your command list, enhance security, and customize your server's command experience. + +## Features + +### Command Management + +- **Hide Commands**: Control which commands appear in tab completion +- **Unregister Commands**: Completely remove commands from the server + +### Permission Control + +- **Override Permissions**: Set custom permissions on any command +- **Query Permissions**: Check current permission settings +- **Add Security**: Restrict commands that originally had no permissions + +### Configuration + +- **JSON Configuration**: Simple, human-readable configuration files +- **Hot Reload**: Apply changes without server restart +- **Manual Editing**: Direct configuration file access + +## Quick Start + +### Basic Usage + +The main command of Commander is `/command` (or `/commandv` on the proxy), +and requires the permission `commander.admin`: + +``` +# Hide commands from players +/command hide plugins +/command hide pl + +# Add permissions to unrestricted commands +/command permission set luckperms luckperms.use + +# Remove dangerous commands entirely +/command unregister op +/command unregister deop + +# Save your changes (not required) +/command save +``` + +### Common Scenarios + +#### Clean Command List + +Hide administrative commands from regular players: +``` +/command hide plugins +/command hide version +``` + +#### Security Hardening + +Remove dangerous commands: +``` +/command unregister op +/command unregister deop +``` + +#### Plugin Integration + +Add permissions to plugin commands that lack them: +``` +/command permission set luckperms luckperms.use +/command permission set eco economy.admin +``` + +## Permission System + +### Required Permissions + +- `commander.admin` - Access to all Commander commands +- `commander.bypass` - See hidden commands (wildcard permissions ignored) + +### Permission Override + +Commander can override permissions on (almost) any command, even those from other plugins. +This allows you to: +- Add permissions to unrestricted commands +- Change existing permissions +- Create world-specific or group-specific command access + +## Wildcard Support + +Commander supports powerful wildcard patterns for bulk operations on commands: + +### Wildcard Patterns + +- `*` - Matches any command name +- `*:*` - Matches any namespaced command (commands with colons) +- `prefix:*` - Matches all commands with a specific namespace prefix +- `*suffix` - Matches all commands ending with a specific suffix + + + Wildcard operations affect many commands at once. + Test carefully and consider using `/command save` before bulk operations. + _To restore from a saved configuration, use `/command reload`._ + + +## Configuration Files + +Commander stores settings in three JSON files: + +- **`hidden-commands.json`** - List of hidden commands +- **`unregistered-commands.json`** - List of unregistered commands +- **`permission-overrides.json`** - Command permission overrides + +## Use Cases + +- Clean up command clutter for players +- Remove dangerous commands like `/op` and `/deop` +- Add security layers to plugin commands +- Create context-specific command access diff --git a/content/docs/commander/meta.json b/content/docs/commander/meta.json index 63a2148..5fa375f 100644 --- a/content/docs/commander/meta.json +++ b/content/docs/commander/meta.json @@ -13,6 +13,11 @@ "index", "faq", "---Guide---", + "hide-reveal", + "unregister-register", + "permissions", + "reset", + "reload-save", "---For Developers---", "api/repository", "api/index" diff --git a/content/docs/commander/permissions.mdx b/content/docs/commander/permissions.mdx new file mode 100644 index 0000000..628e1d5 --- /dev/null +++ b/content/docs/commander/permissions.mdx @@ -0,0 +1,171 @@ +--- +title: Managing Permissions +description: Manage and override command permissions +--- + +# Managing Permissions + +Command permission management allows you to override the default permissions of commands, +set new permissions on commands that originally had none, and query current permission settings. + +## Commands + +### Set Command Permission +Usage: `/command permission set ` +Sets or overrides the permission required to execute a command. + +**Examples:** +``` +# Set permission on specific commands +/command permission set luckperms luckperms.use +/command permission set fly essentials.fly +/command permission set gamemode server.admin.gamemode + +# Set permission on all commands +/command permission set "*" server.admin.all + +# Set permission on all bukkit namespaced commands +/command permission set "bukkit:*" server.admin.bukkit + +# Set permission on all namespaced commands +/command permission set "*:*" plugin.commands +``` + +### Query Command Permission + +Usage: `/command permission query ` +Displays the current permission setting for a command. + +**Examples:** +``` +# Query specific commands +/command permission query luckperms +/command permission query fly + +# Query all commands +/command permission query "*" + +# Query all bukkit namespaced commands +/command permission query "bukkit:*" + +# Query all namespaced commands +/command permission query "*:*" +``` + +### Reset Command Permission +Usage: `/command permission reset ` +Removes any permission override and restores the command's original permission. + +**Examples:** +``` +# Reset specific commands +/command permission reset luckperms +/command permission reset fly + +# Reset all permission overrides +/command permission reset "*" + +# Reset all bukkit namespaced commands +/command permission reset "bukkit:*" + +# Reset all namespaced commands +/command permission reset "*:*" +``` + +### Unset Command Permission + +Usage: `/command permission unset ` +Removes the permission requirement from a command, making it usable by everyone. + +**Examples:** +``` +# Unset permission on specific commands +/command permission unset help +/command permission unset rules + +# Unset permissions on all commands +/command permission unset "*" + +# Unset permissions on all bukkit namespaced commands +/command permission unset "bukkit:*" + +# Unset permissions on all namespaced commands +/command permission unset "*:*" +``` + + + Be careful when unsetting permissions from commands that should be restricted. + + +## Use Cases + +### Adding Permissions to Unrestricted Commands + +Many plugins provide commands without permission requirements. Add security: + +``` +# Add permission to LuckPerms commands +/command permission set luckperms luckperms.admin +/command permission set perms luckperms.admin + +# Add permission to economy commands +/command permission set eco economy.admin +/command permission set balance economy.user +``` + +### Restricting Powerful Commands + +Add additional security layers: + +``` +# Make gamemode command require admin permission +/command permission set gamemode server.admin.gamemode + +# Make world management commands require specific permissions +/command permission set world server.admin.world +/command permission set mv server.admin.multiverse +``` + +### World/Server-Specific Permissions + +Use permission plugins to grant command access only in certain contexts: + +``` +# Set a permission that's only granted in creative world +/command permission set fly creative.fly + +# Set a permission that's only granted on specific servers +/command permission set tp hub.teleport +``` + +### Debugging Permission Issues + +Check what permissions are actually being enforced: + +``` +/command permission query fly +/command permission query gamemode +/command permission query home +``` + +## Configuration + +Permission overrides are stored in a JSON configuration file. +The file maps command names to their permission overrides. + +```json +{ + "luckperms": "luckperms.admin", + "fly": "essentials.fly", + "gamemode": "server.admin.gamemode", + "eco": "economy.admin" +} +``` + +## Tips + +- Commands are referenced without the `/` prefix in the configuration +- Use `/command reload` to reload the configuration if manually edited +- Use `/command save` to ensure changes are persisted to disk +- Query permissions before making changes to understand the current state +- Use permission plugins to grant the new permissions to specific users, groups, or worlds \ No newline at end of file diff --git a/content/docs/commander/reload-save.mdx b/content/docs/commander/reload-save.mdx new file mode 100644 index 0000000..a6bfbee --- /dev/null +++ b/content/docs/commander/reload-save.mdx @@ -0,0 +1,84 @@ +--- +title: Reloading/Saving Configs +description: Manage Commander configuration files +--- + +# Reloading/Saving Configs + +Configuration management allows you to reload Commander settings from disk and manually save changes to ensure persistence. + + + Manual editing requires proper JSON syntax. + Use a JSON validator when editing configuration files manually. + + +## Commands + +### Reload Configuration + +Usage: `/command reload` +Reload all Commander configuration files from disk, applying any changes made manually to the configuration files. + + + Reloading will overwrite any unsaved changes in memory. + + +### Save Configuration + +Usage: `/command save` +Manually saves all current Commander settings to the configuration files, ensuring all changes are persisted. + +## Configuration Files + +Commander uses three separate JSON configuration files to store different types of command modifications: + + + Configuration files are case-sensitive. Use exact command names. + + +### Hidden Commands + +Stores commands that are hidden from tab completions. + +`hidden-commands.json`: +```json +[ + "plugins", + "pl", + "version", + "ver" +] +``` + +### Unregistered Commands + +Stores commands that are completely removed from the server. + +`unregistered-commands.json`: +```json +[ + "op", + "deop", + "stop", + "reload" +] +``` + +### Permission Overrides + +Stores custom permission settings for commands. + +`permission-overrides.json`: +```json +{ + "luckperms": "luckperms.admin", + "fly": "essentials.fly", + "gamemode": "server.admin.gamemode" +} +``` + +## Tips + +- Reload after manual edits to apply changes +- Test changes in a development environment first +- Use JSON linters/validators when editing manually \ No newline at end of file diff --git a/content/docs/commander/reset.mdx b/content/docs/commander/reset.mdx new file mode 100644 index 0000000..36b3633 --- /dev/null +++ b/content/docs/commander/reset.mdx @@ -0,0 +1,62 @@ +--- +title: Resetting Commands +description: Reset commands to their original state +--- + +# Resetting Commands + +The reset command allows you to completely restore a command to its original state, +removing all Commander modifications including hiding, unregistering, and permission overrides. + +## Command + +### Reset a Command + +Usage: `/command reset ` +Completely resets a command to its original state, removing all modifications made by Commander. + +**Examples:** +``` +# Reset specific commands +/command reset luckperms +/command reset fly +/command reset plugins +/command reset op + +# Reset ALL commands (restore everything to original state) +/command reset "*" + +# Reset all bukkit namespaced commands +/command reset "bukkit:*" + +# Reset all namespaced commands +/command reset "*:*" +``` + + + Resetting a command will remove ALL Commander modifications. + If you only want to remove specific modifications, use the appropriate command instead: + - Use `/command reveal` to only unhide a command + - Use `/command register` to only restore an unregistered command + - Use `/command permission reset` to only remove a permission override + + + + Resetting commands that were unregistered for security reasons may expose them to all players again. + + +## Configuration Changes + +When you reset a command, Commander will: + +1. Remove the command from all configuration files +2. Update the hidden commands list +3. Update the unregistered commands list +4. Update the permission overrides list +5. Apply the changes immediately + +## Tips + +- Use reset when you want to completely start over with a command +- Consider the security implications of resetting unregistered commands +- Test the command after resetting to ensure it works as expected \ No newline at end of file diff --git a/content/docs/commander/unregister-register.mdx b/content/docs/commander/unregister-register.mdx new file mode 100644 index 0000000..f185d67 --- /dev/null +++ b/content/docs/commander/unregister-register.mdx @@ -0,0 +1,122 @@ +--- +title: Command Registration +description: Completely remove or restore commands from the server +--- + +# 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 ` +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 ` +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. + +```json +[ + "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 + +| Feature | Hide | Unregister | +|----------------------|---------------------|--------------------| +| Command execution | Still possible | Completely removed | +| Who can use | Anyone who knows it | Nobody | +| Administrator access | Yes (with bypass) | No | +| Use case | Clean UI | Security/Disabling | \ No newline at end of file