From 6426bd087110d616ab1e30980b1c7d5ea9e82359 Mon Sep 17 00:00:00 2001 From: david Date: Fri, 31 Oct 2025 21:42:48 +0100 Subject: [PATCH 1/7] docs: add permissions, reset, unregister, hide, reveal pages --- content/docs/commander/hide-reveal.mdx | 175 +++++++++ content/docs/commander/index.mdx | 104 +++++- content/docs/commander/meta.json | 5 + content/docs/commander/permissions.mdx | 342 ++++++++++++++++++ content/docs/commander/reload-save.mdx | 265 ++++++++++++++ content/docs/commander/reset.mdx | 274 ++++++++++++++ .../docs/commander/unregister-register.mdx | 217 +++++++++++ 7 files changed, 1381 insertions(+), 1 deletion(-) create mode 100644 content/docs/commander/hide-reveal.mdx create mode 100644 content/docs/commander/permissions.mdx create mode 100644 content/docs/commander/reload-save.mdx create mode 100644 content/docs/commander/reset.mdx create mode 100644 content/docs/commander/unregister-register.mdx diff --git a/content/docs/commander/hide-reveal.mdx b/content/docs/commander/hide-reveal.mdx new file mode 100644 index 0000000..de1a33c --- /dev/null +++ b/content/docs/commander/hide-reveal.mdx @@ -0,0 +1,175 @@ +--- +title: Hiding/Revealing Commands +description: Control command visibility in tab completion and help menus +--- + +# Hiding and Revealing Commands + +Hiding commands allows you to control which commands appear in tab completion and help menus, +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 and help menus. Supports wildcards for bulk operations. + +**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 *:* +``` + +### Reveal a Command +Usage: `/command reveal ` +Makes a previously hidden command visible again in tab completion and help menus. Supports wildcards for bulk operations. + +**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 *:* +``` + +## Wildcard Support + +Commander supports powerful wildcard patterns for bulk command operations: + +### 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 + +### Common Wildcard Examples + +``` +# Hide ALL commands (use with caution!) +/command hide * + +# Hide all vanilla Minecraft commands +/command hide minecraft:* + +# Hide all Bukkit/Spigot commands +/command hide bukkit:* + +# Hide all plugin commands (namespaced) +/command hide *:* + +# Hide all commands starting with "admin" +/command hide admin* + +# Hide all commands ending with "list" +/command hide *list +``` + +### Wildcard Use Cases + +#### Complete Command Cleanup +``` +# Hide all namespaced commands (usually plugin commands) +/command hide *:* + +# Then selectively reveal essential ones +/command reveal essentials:* +/command reveal luckperms:* +``` + +#### Plugin Management +``` +# Hide all commands from a specific plugin +/command hide worldedit:* + +# Hide all administrative commands +/command hide admin* +/command hide *admin +``` + +#### Server Type Filtering +``` +# Hide all creative mode commands on a survival server +/command hide fly +/command hide gamemode +/command hide worldedit:* +``` + +### Important Notes + +⚠️ **Warning:** Using `/command hide *` will hide literally ALL commands, including essential ones like `/command` itself. Make sure you have alternative access to restore commands. + +⚠️ **Warning:** Wildcard operations affect many commands at once. Test carefully and consider using `/command save` before bulk operations. + +💡 **Tip:** Use `/command reveal *` to quickly restore all hidden commands. + +💡 **Tip:** Combine wildcards with specific commands for fine-tuned control. + +## Behavior + +### Hidden Commands +- Hidden commands are **still executable** by players who know the command +- Hidden commands don't appear in tab completion +- Hidden commands don't appear in help menus (`/help`, `/?`) +- The command configuration is saved to a JSON file + +### Bypass Permission +Players with the `commander.bypass` permission can see all hidden commands, regardless of other permissions. + +**Important:** 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..d6feecc 100644 --- a/content/docs/commander/index.mdx +++ b/content/docs/commander/index.mdx @@ -4,4 +4,106 @@ 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 +/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 + +## 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..8e717a0 --- /dev/null +++ b/content/docs/commander/permissions.mdx @@ -0,0 +1,342 @@ +--- +title: Overriding/Querying Permissions +description: Manage and override command permissions +--- + +# Overriding/Querying 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 +``` +/command permission set +``` +Sets or overrides the permission required to execute a command. Supports wildcards for bulk operations. + +**Parameters:** +- ``: The command to modify (without the `/` prefix). Supports wildcards. +- ``: The permission node to require + +**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 +``` +/command permission query +``` +Displays the current permission setting for a command. Supports wildcards for bulk queries. + +**Parameters:** +- ``: The command to query (without the `/` prefix). Supports wildcards. + +**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 +``` +/command permission reset +``` +Removes any permission override and restores the command's original permission. Supports wildcards for bulk operations. + +**Parameters:** +- ``: The command to reset (without the `/` prefix). Supports wildcards. + +**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 *:* +``` + +**Example:** +``` +/command permission reset luckperms +/command permission reset fly +``` + +### Unset Command Permission +``` +/command permission unset +``` +Removes the permission requirement from a command, making it usable by everyone. Supports wildcards for bulk operations. + + + +**Parameters:** +- ``: The command to unset permission for (without the `/` prefix). Supports wildcards. + +**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 *:* +``` + +## Wildcard Support + +Commander supports powerful wildcard patterns for bulk permission operations: + +### 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 + +### Common Wildcard Examples + +``` +# Set permission on ALL commands +/command permission set * server.admin.all + +# Set permission on all vanilla Minecraft commands +/command permission set minecraft:* vanilla.commands + +# Set permission on all Bukkit/Spigot commands +/command permission set bukkit:* bukkit.commands + +# Set permission on all plugin commands (namespaced) +/command permission set *:* plugin.commands + +# Set permission on all commands starting with "admin" +/command permission set admin* admin.commands + +# Set permission on all commands ending with "list" +/command permission set *list utility.commands +``` + +### Wildcard Use Cases + +#### Complete Permission Lockdown +``` +# Require admin permission for ALL commands +/command permission set * server.admin.all + +# Then make essential commands available to everyone +/command permission unset help +/command permission unset spawn +/command permission unset rules +``` + +#### Plugin Permission Standardization +``` +# Set consistent permissions for all plugin commands +/command permission set *:* plugin.commands + +# Override specific plugins with custom permissions +/command permission set luckperms:* luckperms.admin +/command permission set essentials:* essentials.admin +``` + +#### Server Type Configuration +``` +# On a creative server, set creative-specific permissions +/command permission set fly creative.fly +/command permission set gamemode creative.gamemode +/command permission set worldedit:* creative.worldedit +``` + +#### Bulk Permission Management +``` +# Remove all permission overrides +/command permission reset * + +# Query all current permission overrides +/command permission query * + +# Unset all permissions (make everything public) +/command permission unset * +``` + +### ⚠️ Important Notes + +🚨 **CAUTION:** Using `/command permission set *` will affect **ALL** commands on the server, including essential ones. + +🚨 **PERMISSION IMPACT:** Wildcard permission changes can lock players out of essential commands. Always have a backup plan. + +💡 **BEST PRACTICE:** Test wildcard operations on a development server first. + +💡 **SELECTIVE APPROACH:** Use specific wildcards (like `prefix:*`) instead of `*` when possible for more control. + +## Permissions + +- `commander.admin` - Required to use all permission management commands + +## Behavior + +### Permission Override +- Overrides the original permission of a command +- The new permission is enforced by Commander +- Original plugin behavior is preserved +- Configuration is saved to a JSON file + +### Permission Query +- Shows the current effective permission for a command +- Displays whether it's using the original permission or an override +- Useful for debugging permission issues + +### Permission Reset +- Removes Commander's permission override +- Restores the command's original permission from its plugin +- If the command had no original permission, it becomes unrestricted + +### Permission Unset +- Completely removes permission requirements +- Makes the command executable by anyone +- Useful for utility commands that should be universally available + +## 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" +} +``` + +## Important Notes + +⚠️ **Warning:** Be careful when unsetting permissions from commands that should be restricted. + +⚠️ **Warning:** Some plugins may not work correctly if their permission system is bypassed. + +💡 **Tip:** Use descriptive permission names that follow your server's permission scheme. + +💡 **Tip:** Combine with permission plugins to create world-specific or group-specific command access. + +## 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 + +## Examples + +### Basic Security Setup +``` +# Add permissions to commonly unrestricted commands +/command permission set plugins server.admin.plugins +/command permission set version server.admin.version +/command permission set reload server.admin.reload + +# Make utility commands available to all players +/command permission unset help +/command permission unset rules +/command permission unset spawn +``` + +### Creative World Commands +``` +# Set creative-specific permissions +/command permission set fly creative.fly +/command permission set gamemode creative.gamemode +/command permission set worldedit creative.worldedit +``` + +### Admin Tools +``` +# Restrict powerful admin commands +/command permission set op server.admin.op +/command permission set whitelist server.admin.whitelist +/command permission set ban server.admin.ban +``` \ 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..ec1e3ff --- /dev/null +++ b/content/docs/commander/reload-save.mdx @@ -0,0 +1,265 @@ +--- +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. + +## Commands + +### Reload Configuration +``` +/command reload +``` +Reload all Commander configuration files from disk, applying any changes made manually to the configuration files. + +### Save Configuration +``` +/command save +``` +Manually saves all current Commander settings to the configuration files, ensuring all changes are persisted. + +## Permissions + +- `commander.admin` - Required to use both reload and save commands + +## Configuration Files + +Commander uses three separate JSON configuration files to store different types of command modifications: + +### Hidden Commands (`hidden.json`) +Stores commands that are hidden from tab completion and help menus. + +```json +[ + "plugins", + "pl", + "version", + "ver" +] +``` + +### Unregistered Commands (`unregistered.json`) +Stores commands that are completely removed from the server. + +```json +[ + "op", + "deop", + "stop", + "reload" +] +``` + +### Permission Overrides (`permissions.json`) +Stores custom permission settings for commands. + +```json +{ + "luckperms": "luckperms.admin", + "fly": "essentials.fly", + "gamemode": "server.admin.gamemode" +} +``` + +## Behavior + +### Reload Command +- Reads all three configuration files from disk +- Applies any changes made to the files +- Updates the in-memory state of Commander +- Overwrites any unsaved changes in memory + +### Save Command +- Writes the current in-memory state to all configuration files +- Ensures all recent changes are persisted +- Creates backup files if they don't exist +- Validates JSON syntax before writing + +## Use Cases + +### Manual Configuration Editing +Edit configuration files directly and reload changes: + +``` +# Edit hidden.json manually to add/remove hidden commands +# Then apply the changes +/command reload +``` + +### Backup and Restore +Save current state before making changes: + +``` +# Save current configuration +/command save + +# Make changes... + +# If something goes wrong, restore from backup and reload +/command reload +``` + +### Multiple Administrators +Ensure changes are synchronized between multiple administrators: + +``` +# After another admin makes changes +/command reload + +# After making your own changes +/command save +``` + +### Server Maintenance +Save configuration before server restarts: + +``` +# Ensure all changes are saved before restart +/command save +# Then restart the server +``` + +### Troubleshooting +Reload configuration to fix issues: + +``` +# If commands aren't behaving as expected +/command reload +``` + +## Manual Configuration + +### Editing Hidden Commands +Edit `plugins/Commander/hidden.json`: + +```json +[ + "plugins", + "pl", + "version", + "ver", + "about", + "bukkit:version" +] +``` + +### Editing Unregistered Commands +Edit `plugins/Commander/unregistered.json`: + +```json +[ + "op", + "deop", + "stop", + "reload", + "bukkit:reload" +] +``` + +### Editing Permission Overrides +Edit `plugins/Commander/permissions.json`: + +```json +{ + "luckperms": "luckperms.admin", + "fly": "essentials.fly", + "gamemode": "server.admin.gamemode", + "eco": "economy.admin" +} +``` + +## Important Notes + +⚠️ **Warning:** Manual editing requires proper JSON syntax. Invalid JSON will cause reload to fail. + +⚠️ **Warning:** Reloading will overwrite any unsaved changes in memory. + +⚠️ **Warning:** Configuration files are case-sensitive. Use exact command names. + +💡 **Tip:** Always save before making manual changes to create a backup. + +💡 **Tip:** Use a JSON validator when editing configuration files manually. + +💡 **Tip:** Commands in configuration files should not include the `/` prefix. + +## Best Practices + +### Regular Saves +``` +# Save after making any changes +/command hide plugins +/command save + +/command permission set fly essentials.fly +/command save +``` + +### Before Manual Editing +``` +# Save current state first +/command save + +# Then edit files manually +# Finally, reload changes +/command reload +``` + +### After Manual Editing +``` +# Always reload after manual edits +/command reload + +# Verify changes took effect +/command permission query fly +``` + +### Troubleshooting Steps +``` +# If commands aren't working correctly +/command save # Save current state +/command reload # Reload from disk +``` + +## File Locations + +Configuration files are typically located at: +``` +plugins/Commander/ +├── hidden.json +├── unregistered.json +└── permissions.json +``` + +The exact location may vary depending on your server setup. + +## Error Handling + +### Invalid JSON +If a configuration file contains invalid JSON: +- Reload will fail with an error message +- Current settings will remain unchanged +- Fix the JSON syntax and try again + +### Missing Files +If configuration files are missing: +- Commander will create new empty files +- Default settings will be used +- Save will create the files with current settings + +### Permission Issues +If Commander can't write to configuration files: +- Save will fail with an error message +- Check file permissions and disk space +- Ensure the plugins directory is writable + +## Tips + +- Use `/command save` frequently to avoid losing changes +- Reload after manual edits to apply changes +- Keep backups of configuration files +- Test changes in a development environment first +- Use JSON linters/validators when editing manually +- Document your configuration changes for future reference \ 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..d88a1f9 --- /dev/null +++ b/content/docs/commander/reset.mdx @@ -0,0 +1,274 @@ +--- +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 +``` +/command reset +``` +Completely resets a command to its original state, removing all modifications made by Commander. Supports wildcards for bulk operations. + +**Parameters:** +- ``: The command to reset (without the `/` prefix). Supports wildcards. + +**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 *:* +``` + +## Permissions + +- `commander.admin` - Required to use the reset command + +## Wildcard Support + +Commander supports powerful wildcard patterns for bulk reset operations: + +### 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 + +### Common Wildcard Examples + +``` +# Reset ALL commands (complete restore) +/command reset * + +# Reset all vanilla Minecraft commands +/command reset minecraft:* + +# Reset all Bukkit/Spigot commands +/command reset bukkit:* + +# Reset all plugin commands (namespaced) +/command reset *:* + +# Reset all commands starting with "admin" +/command reset admin* + +# Reset all commands ending with "list" +/command reset *list +``` + +### Wildcard Use Cases + +#### Complete Server Reset +``` +# Reset everything to original state +/command reset * +``` + +#### Plugin-Specific Reset +``` +# Reset all commands from a specific plugin +/command reset worldedit:* +/command reset essentials:* +/command reset luckperms:* +``` + +#### Category Reset +``` +# Reset all administrative commands +/command reset admin* +/command reset *admin + +# Reset all utility commands +/command reset *list +/command reset *info +``` + +#### Namespace Management +``` +# Reset all namespaced commands (usually plugin commands) +/command reset *:* + +# Keep only vanilla commands modified +/command reset bukkit:* +``` + +### ⚠️ Important Notes + +🚨 **COMPLETE RESET:** Using `/command reset *` will remove **ALL** Commander modifications from **ALL** commands on the server. + +🚨 **SECURITY IMPACT:** Resetting commands that were unregistered for security reasons will make them available again. + +🚨 **PERMISSION CHANGES:** Resetting will restore original permissions, which may be less restrictive than your current setup. + +💡 **BACKUP FIRST:** Consider using `/command save` before bulk reset operations to create a backup. + +💡 **SELECTIVE RESET:** Use specific wildcards (like `prefix:*`) instead of `*` when possible for more control. + +## Behavior + +### What Reset Does + +When you reset a command, Commander will: + +1. **Remove Hiding**: If the command was hidden, it becomes visible again +2. **Restore Registration**: If the command was unregistered, it becomes available again +3. **Remove Permission Override**: If a custom permission was set, the original permission is restored +4. **Clear All Overrides**: Any and all Commander modifications are removed + +### What Reset Affects + +- **Hidden Commands**: Makes them visible in tab completion and help menus +- **Unregistered Commands**: Makes them executable again by all players +- **Permission Overrides**: Restores the original plugin permission or removes permission requirements +- **All States**: Works regardless of the command's current state + +## Use Cases + +### Complete Command Restoration +Reset a command that has multiple modifications: + +``` +# Suppose luckperms was hidden, had a permission override, and was unregistered +/command reset luckperms +# Now luckperms is completely back to its original state +``` + +### Troubleshooting +Reset commands that are behaving unexpectedly: + +``` +# If a command isn't working as expected after multiple changes +/command reset fly +/command reset gamemode +``` + +### Starting Over +Clear all modifications to start fresh: + +``` +# Remove all Commander changes from a command +/command reset plugins +/command reset version +``` + +### Plugin Updates +Reset commands after plugin updates to ensure compatibility: + +``` +# After updating a plugin, reset its commands +/command reset essentials +/command reset eco +``` + +## Examples + +### Single Command Reset +``` +/command reset fly +``` +This will: +- Show `fly` in tab completion if it was hidden +- Make `fly` executable if it was unregistered +- Restore the original permission if it was overridden + +### Multiple Command Resets +``` +/command reset luckperms +/command reset perms +/command reset lp +``` +Reset all LuckPerms-related commands to their original state. + +### Administrative Commands +``` +/command reset op +/command reset deop +/command reset stop +``` +Restore critical administrative commands to their default behavior. + +## Important Notes + +⚠️ **Warning:** 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 + +⚠️ **Warning:** Resetting commands that were unregistered for security reasons may expose them to all players again. + +💡 **Tip:** Use `/command permission query` before resetting to see what modifications are currently applied to a command. + +## 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 + +## Verification + +After resetting a command, you can verify its state: + +``` +# Check if the command is visible and working +/fly + +# Check the permission (if any) +/command permission query fly + +# Try tab completion to see if it appears +/fly +``` + +## Tips + +- Use reset when you want to completely start over with a command +- Consider the security implications of resetting unregistered commands +- Use `/command save` after resetting to ensure configuration is persisted +- Test the command after resetting to ensure it works as expected +- Keep track of which commands you reset for documentation purposes + +## Common Scenarios + +### Accidental Modifications +``` +# Oops! I accidentally hid the plugins command and set a wrong permission +/command reset plugins +# Now plugins is back to normal +``` + +### Testing Cleanup +``` +# After testing various command modifications +/command reset testcommand +/command reset experimental +# Clean slate for next test +``` + +### Security Review +``` +# Review and reset commands that were over-secured +/command reset help +/command reset spawn +# Make essential commands available again +``` \ 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..25c3105 --- /dev/null +++ b/content/docs/commander/unregister-register.mdx @@ -0,0 +1,217 @@ +--- +title: Un-/registering Commands +description: Completely remove or restore commands from the server +--- + +# Un-/registering Commands + +Command registration allows you to completely remove commands from the server or restore previously removed commands. Unlike hiding, unregistered commands cannot be executed by anyone. + +## Commands + +### Unregister a Command +``` +/command unregister +``` +Completely removes a command from the server. The command becomes unusable by all players. Supports wildcards for bulk operations. + +**Parameters:** +- ``: The command to unregister (without the `/` prefix). Supports wildcards. + +**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 *:* +``` + +### Register a Command +``` +/command register +``` +Restores a previously unregistered command, making it available again. Supports wildcards for bulk operations. + +**Parameters:** +- ``: The command to register (without the `/` prefix). Supports wildcards. + +**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 *:* +``` + +## Permissions + +- `commander.admin` - Required to use both unregister and register commands + +## Behavior + +### Unregistered Commands +- Unregistered commands are **completely removed** from the server +- Unregistered commands cannot be executed by anyone, including administrators +- Unregistered commands don't appear in tab completion or help menus +- The command configuration is saved to a JSON file + +### Registered Commands +- Previously unregistered commands become fully functional again +- All original permissions and behavior are restored +- The command appears in tab completion and help menus (unless hidden) + +## Wildcard Support + +Commander supports powerful wildcard patterns for bulk command operations: + +### 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 + +### Common Wildcard Examples + +``` +# Unregister ALL commands (extremely dangerous!) +/command unregister * + +# Unregister all vanilla Minecraft commands +/command unregister minecraft:* + +# Unregister all Bukkit/Spigot commands +/command unregister bukkit:* + +# Unregister all plugin commands (namespaced) +/command unregister *:* + +# Unregister all commands starting with "admin" +/command unregister admin* + +# Unregister all commands ending with "list" +/command unregister *list +``` + +### Wildcard Use Cases + +#### Complete Plugin Removal +``` +# Remove all commands from a specific plugin +/command unregister worldedit:* +/command unregister essentials:* +``` + +#### Server Type Configuration +``` +# On a survival server, remove all creative commands +/command unregister fly +/command unregister gamemode +/command unregister worldedit:* +``` + +#### Security Lockdown +``` +# Remove all administrative commands +/command unregister admin* +/command unregister *admin +/command unregister op +/command unregister deop +``` + +### ⚠️ Critical Warnings + +🚨 **EXTREME CAUTION:** Using `/command unregister *` will remove **ALL** commands from the server, including `/command` itself. This may require server restart or config file editing to recover. + +🚨 **DANGEROUS:** Wildcard unregister operations are irreversible through normal commands. You'll need to edit configuration files manually or use `/command register *` to restore. + +🚨 **PLUGIN COMPATIBILITY:** Unregistering all commands from a plugin may cause the plugin to malfunction or crash. + +## Use Cases + +### Security Hardening +Remove dangerous commands that should never be used: +``` +/command unregister op +/command unregister deop +/command unregister stop +/command unregister reload + +# Remove all administrative commands at once +/command unregister admin* +``` + +### Plugin Management +Remove commands from plugins you don't want players to use: +``` +/command unregister essentials +/command unregister eco +``` + +### Temporary Disabling +Unregister commands temporarily during events or maintenance: +``` +/command unregister tp +/command unregister home +``` + +### Server-Specific Commands +Unregister commands that don't apply to your server type: +``` +# On a survival server, unregister creative commands +/command unregister gamemode +/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" +] +``` + +## Important Notes + +⚠️ **Warning:** Be careful when unregistering essential commands. Some unregistered commands may require a server restart to be properly restored. + +⚠️ **Warning:** Unregistering commands from other plugins may cause those plugins to malfunction. Always test in a development environment first. + +## 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 blocked | +| 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 From ee7bcec05739f443c59a0234fa99a64762880126 Mon Sep 17 00:00:00 2001 From: david Date: Sat, 1 Nov 2025 08:52:32 +0100 Subject: [PATCH 2/7] docs: update hide/reveal command descriptions and examples --- content/docs/commander/hide-reveal.mdx | 94 ++++++++++++++------------ 1 file changed, 49 insertions(+), 45 deletions(-) diff --git a/content/docs/commander/hide-reveal.mdx b/content/docs/commander/hide-reveal.mdx index de1a33c..83be3f0 100644 --- a/content/docs/commander/hide-reveal.mdx +++ b/content/docs/commander/hide-reveal.mdx @@ -1,11 +1,11 @@ --- title: Hiding/Revealing Commands -description: Control command visibility in tab completion and help menus +description: Control command visibility in tab completion --- # Hiding and Revealing Commands -Hiding commands allows you to control which commands appear in tab completion and help menus, +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 @@ -13,7 +13,8 @@ creating a cleaner experience for players while still allowing the commands to b ### Hide a Command Usage: `/command hide ` -Hides a command from tab completion and help menus. Supports wildcards for bulk operations. +Hides a command from tab completion. +Supports wildcards for bulk operations. **Examples:** ``` @@ -22,18 +23,19 @@ Hides a command from tab completion and help menus. Supports wildcards for bulk /command hide pl # Hide all commands -/command hide * +/command hide "*" # Hide all bukkit namespaced commands -/command hide bukkit:* +/command hide "bukkit:*" # Hide all namespaced commands -/command hide *:* +/command hide "*:*" ``` ### Reveal a Command Usage: `/command reveal ` -Makes a previously hidden command visible again in tab completion and help menus. Supports wildcards for bulk operations. +Makes a previously hidden command visible again in tab completions. +Supports wildcards for bulk operations. **Examples:** ``` @@ -42,13 +44,13 @@ Makes a previously hidden command visible again in tab completion and help menus /command reveal pl # Reveal all hidden commands -/command reveal * +/command reveal "*" # Reveal all bukkit namespaced commands -/command reveal bukkit:* +/command reveal "bukkit:*" # Reveal all namespaced commands -/command reveal *:* +/command reveal "*:*" ``` ## Wildcard Support @@ -58,52 +60,44 @@ Commander supports powerful wildcard patterns for bulk command operations: ### Wildcard Patterns - `*` - Matches any command name -- `:*` - Matches any namespaced command (commands with colons) +- `*:*` - 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 ### Common Wildcard Examples ``` -# Hide ALL commands (use with caution!) -/command hide * +# Hide ALL commands +/command hide "*" # Hide all vanilla Minecraft commands -/command hide minecraft:* +/command hide "minecraft:*" -# Hide all Bukkit/Spigot commands -/command hide bukkit:* +# Hide all Bukkit/Spigot/Paper commands +/command hide "bukkit:*" +/command hide "spigot:*" +/command hide "paper:*" -# Hide all plugin commands (namespaced) -/command hide *:* +# Hide all namespaced commands +/command hide "*:*" # Hide all commands starting with "admin" -/command hide admin* +/command hide "admin*" # Hide all commands ending with "list" -/command hide *list +/command hide "*list" ``` ### Wildcard Use Cases #### Complete Command Cleanup ``` -# Hide all namespaced commands (usually plugin commands) -/command hide *:* +# Hide all namespaced commands +/command hide "*:*" # Then selectively reveal essential ones -/command reveal essentials:* -/command reveal luckperms:* -``` - -#### Plugin Management -``` -# Hide all commands from a specific plugin -/command hide worldedit:* - -# Hide all administrative commands -/command hide admin* -/command hide *admin +/command reveal "essentials:*" +/command reveal "luckperms:*" ``` #### Server Type Filtering @@ -111,31 +105,40 @@ Commander supports powerful wildcard patterns for bulk command operations: # Hide all creative mode commands on a survival server /command hide fly /command hide gamemode -/command hide worldedit:* +/command hide "worldedit:*" ``` ### Important Notes -⚠️ **Warning:** Using `/command hide *` will hide literally ALL commands, including essential ones like `/command` itself. Make sure you have alternative access to restore commands. + + Using `/command hide "*"` will hide literally ALL commands, + including essential ones like `/command` itself. + -⚠️ **Warning:** Wildcard operations affect many commands at once. Test carefully and consider using `/command save` before bulk operations. + + Wildcard operations affect many commands at once. + Test carefully and consider using `/command save` before bulk operations. + -💡 **Tip:** Use `/command reveal *` to quickly restore all hidden commands. - -💡 **Tip:** Combine wildcards with specific commands for fine-tuned control. + + Use `/command reveal "*"` to quickly restore all hidden commands. + ## Behavior ### Hidden Commands + - Hidden commands are **still executable** by players who know the command - Hidden commands don't appear in tab completion -- Hidden commands don't appear in help menus (`/help`, `/?`) -- The command configuration is saved to a JSON file +- Hidden commands **still appear** in help menus (`/help`, `/?`) ### Bypass Permission -Players with the `commander.bypass` permission can see all hidden commands, regardless of other permissions. +Players with the `commander.bypass` permission can see all hidden commands. -**Important:** Wildcard permissions (like `*`) are ignored for the bypass permission. Players must have the explicit `commander.bypass` permission to see 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 @@ -156,7 +159,8 @@ 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 are stored in a JSON configuration file. +The file contains a simple array of command names that should be hidden. `hidden-commands.json`: ```json From 622ad5d075c05710b7566dd5e87ec887c70dbf9e Mon Sep 17 00:00:00 2001 From: david Date: Sat, 1 Nov 2025 08:52:40 +0100 Subject: [PATCH 3/7] docs: clarify save command optionality --- content/docs/commander/index.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/docs/commander/index.mdx b/content/docs/commander/index.mdx index d6feecc..4137c2a 100644 --- a/content/docs/commander/index.mdx +++ b/content/docs/commander/index.mdx @@ -48,7 +48,7 @@ and requires the permission `commander.admin`: /command unregister op /command unregister deop -# Save your changes +# Save your changes (not required) /command save ``` From ae04b5fe2f3e10fb7cddda2f3c86385f91ff12f3 Mon Sep 17 00:00:00 2001 From: david Date: Sat, 1 Nov 2025 09:22:09 +0100 Subject: [PATCH 4/7] docs: add warnings for wildcard hide/reveal commands --- content/docs/commander/hide-reveal.mdx | 35 ++++++++------------------ 1 file changed, 11 insertions(+), 24 deletions(-) diff --git a/content/docs/commander/hide-reveal.mdx b/content/docs/commander/hide-reveal.mdx index 83be3f0..f2469b0 100644 --- a/content/docs/commander/hide-reveal.mdx +++ b/content/docs/commander/hide-reveal.mdx @@ -64,6 +64,17 @@ Commander supports powerful wildcard patterns for bulk command operations: - `prefix:*` - Matches all commands with a specific namespace prefix - `*suffix` - Matches all commands ending with a specific suffix + + + Using `/command hide "*"` will hide literally **ALL** commands, including `/command` itself. + Use `/command reveal "*"` to quickly restore all hidden commands. + + + + Wildcard operations affect many commands at once. + Test carefully and consider using `/command save` before bulk operations. + + ### Common Wildcard Examples ``` @@ -100,30 +111,6 @@ Commander supports powerful wildcard patterns for bulk command operations: /command reveal "luckperms:*" ``` -#### Server Type Filtering -``` -# Hide all creative mode commands on a survival server -/command hide fly -/command hide gamemode -/command hide "worldedit:*" -``` - -### Important Notes - - - Using `/command hide "*"` will hide literally ALL commands, - including essential ones like `/command` itself. - - - - Wildcard operations affect many commands at once. - Test carefully and consider using `/command save` before bulk operations. - - - - Use `/command reveal "*"` to quickly restore all hidden commands. - - ## Behavior ### Hidden Commands From 5056f67f68f2fa008bff59ca79538cb64efbd0a4 Mon Sep 17 00:00:00 2001 From: david Date: Sat, 1 Nov 2025 09:22:12 +0100 Subject: [PATCH 5/7] docs: clarify unregister command usage and warnings --- .../docs/commander/unregister-register.mdx | 183 ++++++++---------- 1 file changed, 77 insertions(+), 106 deletions(-) diff --git a/content/docs/commander/unregister-register.mdx b/content/docs/commander/unregister-register.mdx index 25c3105..87b459d 100644 --- a/content/docs/commander/unregister-register.mdx +++ b/content/docs/commander/unregister-register.mdx @@ -5,59 +5,59 @@ description: Completely remove or restore commands from the server # Un-/registering Commands -Command registration allows you to completely remove commands from the server or restore previously removed commands. Unlike hiding, unregistered commands cannot be executed by anyone. +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 -``` -/command unregister -``` -Completely removes a command from the server. The command becomes unusable by all players. Supports wildcards for bulk operations. -**Parameters:** -- ``: The command to unregister (without the `/` prefix). Supports wildcards. +Usage: `/command unregister ` +Completely removes a command from the server. +_Supports wildcards for bulk operations._ **Examples:** ``` -# Unregister specific commands -/command unregister op -/command unregister deop -/command unregister stop +# Unregister specific commands +/command unregister op +/command unregister deop +/command unregister stop -# Unregister all commands (use with extreme caution!) -/command unregister * +# Unregister all commands (use with extreme caution!) +/command unregister "*" -# Unregister all bukkit namespaced commands -/command unregister bukkit:* +# Unregister all bukkit namespaced commands +/command unregister "bukkit:*" -# Unregister all namespaced commands -/command unregister *:* +# Unregister all namespaced commands +/command unregister "*:*" ``` ### Register a Command + ``` /command register ``` -Restores a previously unregistered command, making it available again. Supports wildcards for bulk operations. +Restores a previously unregistered command, making it available again. +_Supports wildcards for bulk operations._ **Parameters:** - ``: The command to register (without the `/` prefix). Supports wildcards. **Examples:** ``` -# Register specific commands -/command register op -/command register deop +# Register specific commands +/command register op +/command register deop -# Register all unregistered commands -/command register * +# Register all unregistered commands +/command register "*" -# Register all bukkit namespaced commands -/command register bukkit:* +# Register all bukkit namespaced commands +/command register "bukkit:*" -# Register all namespaced commands -/command register *:* +# Register all namespaced commands +/command register "*:*" ``` ## Permissions @@ -73,9 +73,10 @@ Restores a previously unregistered command, making it available again. Supports - The command configuration is saved to a JSON file ### Registered Commands + - Previously unregistered commands become fully functional again - All original permissions and behavior are restored -- The command appears in tab completion and help menus (unless hidden) +- The command appears in tab completions again (unless hidden) ## Wildcard Support @@ -88,101 +89,77 @@ Commander supports powerful wildcard patterns for bulk command operations: - `prefix:*` - Matches all commands with a specific namespace prefix - `*suffix` - Matches all commands ending with a specific suffix -### Common Wildcard Examples - -``` -# Unregister ALL commands (extremely dangerous!) -/command unregister * - -# Unregister all vanilla Minecraft commands -/command unregister minecraft:* - -# Unregister all Bukkit/Spigot commands -/command unregister bukkit:* - -# Unregister all plugin commands (namespaced) -/command unregister *:* - -# Unregister all commands starting with "admin" -/command unregister admin* + + 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._ + -# Unregister all commands ending with "list" -/command unregister *list -``` - -### Wildcard Use Cases + + 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`._ + -#### Complete Plugin Removal -``` -# Remove all commands from a specific plugin -/command unregister worldedit:* -/command unregister essentials:* -``` +### Common Wildcard Examples -#### Server Type Configuration -``` -# On a survival server, remove all creative commands -/command unregister fly -/command unregister gamemode -/command unregister worldedit:* ``` +# Unregister ALL commands (use with caution!) +/command unregister "*" -#### Security Lockdown -``` -# Remove all administrative commands -/command unregister admin* -/command unregister *admin -/command unregister op -/command unregister deop -``` +# Unregister all vanilla Minecraft commands +/command unregister "minecraft:*" -### ⚠️ Critical Warnings +# Unregister all Bukkit/Spigot/Paper commands +/command unregister "bukkit:*" +/command unregister "spigot:*" +/command unregister "paper:*" -🚨 **EXTREME CAUTION:** Using `/command unregister *` will remove **ALL** commands from the server, including `/command` itself. This may require server restart or config file editing to recover. +# Unregister all namespaced commands +/command unregister "*:*" -🚨 **DANGEROUS:** Wildcard unregister operations are irreversible through normal commands. You'll need to edit configuration files manually or use `/command register *` to restore. +# Unregister all commands starting with "admin" +/command unregister "admin*" -🚨 **PLUGIN COMPATIBILITY:** Unregistering all commands from a plugin may cause the plugin to malfunction or crash. +# Unregister all commands ending with "list" +/command unregister "*list" +``` ## Use Cases ### Security Hardening -Remove dangerous commands that should never be used: -``` -/command unregister op -/command unregister deop -/command unregister stop -/command unregister reload -# Remove all administrative commands at once -/command unregister admin* -``` - -### Plugin Management -Remove commands from plugins you don't want players to use: +Remove dangerous commands that should never be used: ``` -/command unregister essentials -/command unregister eco +/command unregister op +/command unregister deop +/command unregister stop +/command unregister reload ``` ### Temporary Disabling + Unregister commands temporarily during events or maintenance: ``` -/command unregister tp -/command unregister home +/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: ``` -# On a survival server, unregister creative commands -/command unregister gamemode -/command unregister fly +/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. +Unregistered commands are stored in a JSON configuration file. +The file contains a simple array of command names that should be unregistered. ```json [ @@ -193,12 +170,6 @@ Unregistered commands are stored in a JSON configuration file. The file contains ] ``` -## Important Notes - -⚠️ **Warning:** Be careful when unregistering essential commands. Some unregistered commands may require a server restart to be properly restored. - -⚠️ **Warning:** Unregistering commands from other plugins may cause those plugins to malfunction. Always test in a development environment first. - ## Tips - Commands are unregistered without the `/` prefix in the configuration @@ -209,9 +180,9 @@ Unregistered commands are stored in a JSON configuration file. The file contains ## Difference from Hiding -| Feature | Hide | Unregister | -|---------|------|------------| -| Command execution | Still possible | Completely blocked | -| 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 +| 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 From 98f3a82ac548c6190f24a90c600811a93c167f23 Mon Sep 17 00:00:00 2001 From: david Date: Sat, 1 Nov 2025 11:11:24 +0100 Subject: [PATCH 6/7] Update permissions, reset, reload, save, hide, reveal docs --- content/docs/commander/hide-reveal.mdx | 75 +--- content/docs/commander/index.mdx | 19 +- content/docs/commander/permissions.mdx | 325 +++++------------- content/docs/commander/reload-save.mdx | 237 ++----------- content/docs/commander/reset.mdx | 264 ++------------ .../docs/commander/unregister-register.mdx | 84 +---- 6 files changed, 164 insertions(+), 840 deletions(-) diff --git a/content/docs/commander/hide-reveal.mdx b/content/docs/commander/hide-reveal.mdx index f2469b0..7045499 100644 --- a/content/docs/commander/hide-reveal.mdx +++ b/content/docs/commander/hide-reveal.mdx @@ -14,7 +14,6 @@ creating a cleaner experience for players while still allowing the commands to b Usage: `/command hide ` Hides a command from tab completion. -Supports wildcards for bulk operations. **Examples:** ``` @@ -32,10 +31,14 @@ Supports wildcards for bulk operations. /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. -Supports wildcards for bulk operations. **Examples:** ``` @@ -53,73 +56,7 @@ Supports wildcards for bulk operations. /command reveal "*:*" ``` -## Wildcard Support - -Commander supports powerful wildcard patterns for bulk command operations: - -### 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 - - - - Using `/command hide "*"` will hide literally **ALL** commands, including `/command` itself. - Use `/command reveal "*"` to quickly restore all hidden commands. - - - - Wildcard operations affect many commands at once. - Test carefully and consider using `/command save` before bulk operations. - - -### Common Wildcard Examples - -``` -# Hide ALL commands -/command hide "*" - -# Hide all vanilla Minecraft commands -/command hide "minecraft:*" - -# Hide all Bukkit/Spigot/Paper commands -/command hide "bukkit:*" -/command hide "spigot:*" -/command hide "paper:*" - -# Hide all namespaced commands -/command hide "*:*" - -# Hide all commands starting with "admin" -/command hide "admin*" - -# Hide all commands ending with "list" -/command hide "*list" -``` - -### Wildcard Use Cases - -#### Complete Command Cleanup -``` -# Hide all namespaced commands -/command hide "*:*" - -# Then selectively reveal essential ones -/command reveal "essentials:*" -/command reveal "luckperms:*" -``` - -## Behavior - -### Hidden Commands - -- Hidden commands are **still executable** by players who know the command -- Hidden commands don't appear in tab completion -- Hidden commands **still appear** in help menus (`/help`, `/?`) - -### Bypass Permission +## Bypass Permission Players with the `commander.bypass` permission can see all hidden commands. diff --git a/content/docs/commander/index.mdx b/content/docs/commander/index.mdx index 4137c2a..ec241ae 100644 --- a/content/docs/commander/index.mdx +++ b/content/docs/commander/index.mdx @@ -34,7 +34,7 @@ Clean up your command list, enhance security, and customize your server's comman ### Basic Usage The main command of Commander is `/command` (or `/commandv` on the proxy), -and requires the permission `commander.admin`: +and requires the permission `commander.admin`: ``` # Hide commands from players @@ -93,6 +93,23 @@ This allows you to: - 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: diff --git a/content/docs/commander/permissions.mdx b/content/docs/commander/permissions.mdx index 8e717a0..628e1d5 100644 --- a/content/docs/commander/permissions.mdx +++ b/content/docs/commander/permissions.mdx @@ -1,287 +1,157 @@ --- -title: Overriding/Querying Permissions +title: Managing Permissions description: Manage and override command permissions --- -# Overriding/Querying 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. +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 -``` -/command permission set -``` -Sets or overrides the permission required to execute a command. Supports wildcards for bulk operations. - -**Parameters:** -- ``: The command to modify (without the `/` prefix). Supports wildcards. -- ``: The permission node to require +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 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 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 bukkit namespaced commands +/command permission set "bukkit:*" server.admin.bukkit -# Set permission on all namespaced commands -/command permission set *:* plugin.commands +# Set permission on all namespaced commands +/command permission set "*:*" plugin.commands ``` ### Query Command Permission -``` -/command permission query -``` -Displays the current permission setting for a command. Supports wildcards for bulk queries. -**Parameters:** -- ``: The command to query (without the `/` prefix). Supports wildcards. +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 specific commands +/command permission query luckperms +/command permission query fly -# Query all commands -/command permission query * +# Query all commands +/command permission query "*" -# Query all bukkit namespaced commands -/command permission query bukkit:* +# Query all bukkit namespaced commands +/command permission query "bukkit:*" -# Query all namespaced commands -/command permission query *:* +# Query all namespaced commands +/command permission query "*:*" ``` ### Reset Command Permission -``` -/command permission reset -``` -Removes any permission override and restores the command's original permission. Supports wildcards for bulk operations. - -**Parameters:** -- ``: The command to reset (without the `/` prefix). Supports wildcards. +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 specific commands +/command permission reset luckperms +/command permission reset fly -# Reset all permission overrides -/command permission reset * +# Reset all permission overrides +/command permission reset "*" -# Reset all bukkit namespaced commands -/command permission reset bukkit:* +# Reset all bukkit namespaced commands +/command permission reset "bukkit:*" -# Reset all namespaced commands -/command permission reset *:* -``` - -**Example:** -``` -/command permission reset luckperms -/command permission reset fly +# Reset all namespaced commands +/command permission reset "*:*" ``` ### Unset Command Permission -``` -/command permission unset -``` -Removes the permission requirement from a command, making it usable by everyone. Supports wildcards for bulk operations. - - -**Parameters:** -- ``: The command to unset permission for (without the `/` prefix). Supports wildcards. +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 *:* -``` - -## Wildcard Support - -Commander supports powerful wildcard patterns for bulk permission operations: - -### 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 - -### Common Wildcard Examples - -``` -# Set permission on ALL commands -/command permission set * server.admin.all - -# Set permission on all vanilla Minecraft commands -/command permission set minecraft:* vanilla.commands - -# Set permission on all Bukkit/Spigot commands -/command permission set bukkit:* bukkit.commands - -# Set permission on all plugin commands (namespaced) -/command permission set *:* plugin.commands - -# Set permission on all commands starting with "admin" -/command permission set admin* admin.commands - -# Set permission on all commands ending with "list" -/command permission set *list utility.commands -``` - -### Wildcard Use Cases - -#### Complete Permission Lockdown -``` -# Require admin permission for ALL commands -/command permission set * server.admin.all - -# Then make essential commands available to everyone -/command permission unset help -/command permission unset spawn -/command permission unset rules -``` +# Unset permission on specific commands +/command permission unset help +/command permission unset rules -#### Plugin Permission Standardization -``` -# Set consistent permissions for all plugin commands -/command permission set *:* plugin.commands - -# Override specific plugins with custom permissions -/command permission set luckperms:* luckperms.admin -/command permission set essentials:* essentials.admin -``` - -#### Server Type Configuration -``` -# On a creative server, set creative-specific permissions -/command permission set fly creative.fly -/command permission set gamemode creative.gamemode -/command permission set worldedit:* creative.worldedit -``` - -#### Bulk Permission Management -``` -# Remove all permission overrides -/command permission reset * +# Unset permissions on all commands +/command permission unset "*" -# Query all current permission overrides -/command permission query * +# Unset permissions on all bukkit namespaced commands +/command permission unset "bukkit:*" -# Unset all permissions (make everything public) -/command permission unset * +# Unset permissions on all namespaced commands +/command permission unset "*:*" ``` -### ⚠️ Important Notes - -🚨 **CAUTION:** Using `/command permission set *` will affect **ALL** commands on the server, including essential ones. - -🚨 **PERMISSION IMPACT:** Wildcard permission changes can lock players out of essential commands. Always have a backup plan. - -💡 **BEST PRACTICE:** Test wildcard operations on a development server first. - -💡 **SELECTIVE APPROACH:** Use specific wildcards (like `prefix:*`) instead of `*` when possible for more control. - -## Permissions - -- `commander.admin` - Required to use all permission management commands - -## Behavior - -### Permission Override -- Overrides the original permission of a command -- The new permission is enforced by Commander -- Original plugin behavior is preserved -- Configuration is saved to a JSON file - -### Permission Query -- Shows the current effective permission for a command -- Displays whether it's using the original permission or an override -- Useful for debugging permission issues - -### Permission Reset -- Removes Commander's permission override -- Restores the command's original permission from its plugin -- If the command had no original permission, it becomes unrestricted - -### Permission Unset -- Completely removes permission requirements -- Makes the command executable by anyone -- Useful for utility commands that should be universally available + + 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 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 +# 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 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 +# 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 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 +# 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 +/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. +Permission overrides are stored in a JSON configuration file. +The file maps command names to their permission overrides. ```json { @@ -292,51 +162,10 @@ Permission overrides are stored in a JSON configuration file. The file maps comm } ``` -## Important Notes - -⚠️ **Warning:** Be careful when unsetting permissions from commands that should be restricted. - -⚠️ **Warning:** Some plugins may not work correctly if their permission system is bypassed. - -💡 **Tip:** Use descriptive permission names that follow your server's permission scheme. - -💡 **Tip:** Combine with permission plugins to create world-specific or group-specific command access. - ## 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 - -## Examples - -### Basic Security Setup -``` -# Add permissions to commonly unrestricted commands -/command permission set plugins server.admin.plugins -/command permission set version server.admin.version -/command permission set reload server.admin.reload - -# Make utility commands available to all players -/command permission unset help -/command permission unset rules -/command permission unset spawn -``` - -### Creative World Commands -``` -# Set creative-specific permissions -/command permission set fly creative.fly -/command permission set gamemode creative.gamemode -/command permission set worldedit creative.worldedit -``` - -### Admin Tools -``` -# Restrict powerful admin commands -/command permission set op server.admin.op -/command permission set whitelist server.admin.whitelist -/command permission set ban server.admin.ban -``` \ No newline at end of file +- 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 index ec1e3ff..a6bfbee 100644 --- a/content/docs/commander/reload-save.mdx +++ b/content/docs/commander/reload-save.mdx @@ -7,31 +7,40 @@ description: Manage Commander configuration files 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 -``` -/command reload -``` + +Usage: `/command reload` Reload all Commander configuration files from disk, applying any changes made manually to the configuration files. -### Save Configuration -``` -/command save -``` -Manually saves all current Commander settings to the configuration files, ensuring all changes are persisted. + + Reloading will overwrite any unsaved changes in memory. + -## Permissions +### Save Configuration -- `commander.admin` - Required to use both reload and save commands +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: -### Hidden Commands (`hidden.json`) -Stores commands that are hidden from tab completion and help menus. + + Configuration files are case-sensitive. Use exact command names. + +### Hidden Commands + +Stores commands that are hidden from tab completions. + +`hidden-commands.json`: ```json [ "plugins", @@ -41,9 +50,11 @@ Stores commands that are hidden from tab completion and help menus. ] ``` -### Unregistered Commands (`unregistered.json`) +### Unregistered Commands + Stores commands that are completely removed from the server. +`unregistered-commands.json`: ```json [ "op", @@ -53,9 +64,11 @@ Stores commands that are completely removed from the server. ] ``` -### Permission Overrides (`permissions.json`) +### Permission Overrides + Stores custom permission settings for commands. +`permission-overrides.json`: ```json { "luckperms": "luckperms.admin", @@ -64,202 +77,8 @@ Stores custom permission settings for commands. } ``` -## Behavior - -### Reload Command -- Reads all three configuration files from disk -- Applies any changes made to the files -- Updates the in-memory state of Commander -- Overwrites any unsaved changes in memory - -### Save Command -- Writes the current in-memory state to all configuration files -- Ensures all recent changes are persisted -- Creates backup files if they don't exist -- Validates JSON syntax before writing - -## Use Cases - -### Manual Configuration Editing -Edit configuration files directly and reload changes: - -``` -# Edit hidden.json manually to add/remove hidden commands -# Then apply the changes -/command reload -``` - -### Backup and Restore -Save current state before making changes: - -``` -# Save current configuration -/command save - -# Make changes... - -# If something goes wrong, restore from backup and reload -/command reload -``` - -### Multiple Administrators -Ensure changes are synchronized between multiple administrators: - -``` -# After another admin makes changes -/command reload - -# After making your own changes -/command save -``` - -### Server Maintenance -Save configuration before server restarts: - -``` -# Ensure all changes are saved before restart -/command save -# Then restart the server -``` - -### Troubleshooting -Reload configuration to fix issues: - -``` -# If commands aren't behaving as expected -/command reload -``` - -## Manual Configuration - -### Editing Hidden Commands -Edit `plugins/Commander/hidden.json`: - -```json -[ - "plugins", - "pl", - "version", - "ver", - "about", - "bukkit:version" -] -``` - -### Editing Unregistered Commands -Edit `plugins/Commander/unregistered.json`: - -```json -[ - "op", - "deop", - "stop", - "reload", - "bukkit:reload" -] -``` - -### Editing Permission Overrides -Edit `plugins/Commander/permissions.json`: - -```json -{ - "luckperms": "luckperms.admin", - "fly": "essentials.fly", - "gamemode": "server.admin.gamemode", - "eco": "economy.admin" -} -``` - -## Important Notes - -⚠️ **Warning:** Manual editing requires proper JSON syntax. Invalid JSON will cause reload to fail. - -⚠️ **Warning:** Reloading will overwrite any unsaved changes in memory. - -⚠️ **Warning:** Configuration files are case-sensitive. Use exact command names. - -💡 **Tip:** Always save before making manual changes to create a backup. - -💡 **Tip:** Use a JSON validator when editing configuration files manually. - -💡 **Tip:** Commands in configuration files should not include the `/` prefix. - -## Best Practices - -### Regular Saves -``` -# Save after making any changes -/command hide plugins -/command save - -/command permission set fly essentials.fly -/command save -``` - -### Before Manual Editing -``` -# Save current state first -/command save - -# Then edit files manually -# Finally, reload changes -/command reload -``` - -### After Manual Editing -``` -# Always reload after manual edits -/command reload - -# Verify changes took effect -/command permission query fly -``` - -### Troubleshooting Steps -``` -# If commands aren't working correctly -/command save # Save current state -/command reload # Reload from disk -``` - -## File Locations - -Configuration files are typically located at: -``` -plugins/Commander/ -├── hidden.json -├── unregistered.json -└── permissions.json -``` - -The exact location may vary depending on your server setup. - -## Error Handling - -### Invalid JSON -If a configuration file contains invalid JSON: -- Reload will fail with an error message -- Current settings will remain unchanged -- Fix the JSON syntax and try again - -### Missing Files -If configuration files are missing: -- Commander will create new empty files -- Default settings will be used -- Save will create the files with current settings - -### Permission Issues -If Commander can't write to configuration files: -- Save will fail with an error message -- Check file permissions and disk space -- Ensure the plugins directory is writable - ## Tips -- Use `/command save` frequently to avoid losing changes - Reload after manual edits to apply changes -- Keep backups of configuration files - Test changes in a development environment first -- Use JSON linters/validators when editing manually -- Document your configuration changes for future reference \ No newline at end of file +- 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 index d88a1f9..36b3633 100644 --- a/content/docs/commander/reset.mdx +++ b/content/docs/commander/reset.mdx @@ -5,215 +5,45 @@ 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. +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 -``` -/command reset -``` -Completely resets a command to its original state, removing all modifications made by Commander. Supports wildcards for bulk operations. -**Parameters:** -- ``: The command to reset (without the `/` prefix). Supports wildcards. +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 *:* -``` - -## Permissions - -- `commander.admin` - Required to use the reset command - -## Wildcard Support - -Commander supports powerful wildcard patterns for bulk reset operations: - -### 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 - -### Common Wildcard Examples - -``` -# Reset ALL commands (complete restore) -/command reset * - -# Reset all vanilla Minecraft commands -/command reset minecraft:* - -# Reset all Bukkit/Spigot commands -/command reset bukkit:* - -# Reset all plugin commands (namespaced) -/command reset *:* - -# Reset all commands starting with "admin" -/command reset admin* - -# Reset all commands ending with "list" -/command reset *list -``` - -### Wildcard Use Cases - -#### Complete Server Reset -``` -# Reset everything to original state -/command reset * -``` - -#### Plugin-Specific Reset -``` -# Reset all commands from a specific plugin -/command reset worldedit:* -/command reset essentials:* -/command reset luckperms:* -``` - -#### Category Reset -``` -# Reset all administrative commands -/command reset admin* -/command reset *admin - -# Reset all utility commands -/command reset *list -/command reset *info -``` - -#### Namespace Management -``` -# Reset all namespaced commands (usually plugin commands) -/command reset *:* - -# Keep only vanilla commands modified -/command reset bukkit:* -``` - -### ⚠️ Important Notes - -🚨 **COMPLETE RESET:** Using `/command reset *` will remove **ALL** Commander modifications from **ALL** commands on the server. - -🚨 **SECURITY IMPACT:** Resetting commands that were unregistered for security reasons will make them available again. - -🚨 **PERMISSION CHANGES:** Resetting will restore original permissions, which may be less restrictive than your current setup. - -💡 **BACKUP FIRST:** Consider using `/command save` before bulk reset operations to create a backup. - -💡 **SELECTIVE RESET:** Use specific wildcards (like `prefix:*`) instead of `*` when possible for more control. - -## Behavior - -### What Reset Does - -When you reset a command, Commander will: - -1. **Remove Hiding**: If the command was hidden, it becomes visible again -2. **Restore Registration**: If the command was unregistered, it becomes available again -3. **Remove Permission Override**: If a custom permission was set, the original permission is restored -4. **Clear All Overrides**: Any and all Commander modifications are removed - -### What Reset Affects - -- **Hidden Commands**: Makes them visible in tab completion and help menus -- **Unregistered Commands**: Makes them executable again by all players -- **Permission Overrides**: Restores the original plugin permission or removes permission requirements -- **All States**: Works regardless of the command's current state - -## Use Cases - -### Complete Command Restoration -Reset a command that has multiple modifications: - -``` -# Suppose luckperms was hidden, had a permission override, and was unregistered -/command reset luckperms -# Now luckperms is completely back to its original state -``` +# Reset specific commands +/command reset luckperms +/command reset fly +/command reset plugins +/command reset op -### Troubleshooting -Reset commands that are behaving unexpectedly: - -``` -# If a command isn't working as expected after multiple changes -/command reset fly -/command reset gamemode -``` +# Reset ALL commands (restore everything to original state) +/command reset "*" -### Starting Over -Clear all modifications to start fresh: +# Reset all bukkit namespaced commands +/command reset "bukkit:*" +# Reset all namespaced commands +/command reset "*:*" ``` -# Remove all Commander changes from a command -/command reset plugins -/command reset version -``` - -### Plugin Updates -Reset commands after plugin updates to ensure compatibility: -``` -# After updating a plugin, reset its commands -/command reset essentials -/command reset eco -``` + + 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 + -## Examples - -### Single Command Reset -``` -/command reset fly -``` -This will: -- Show `fly` in tab completion if it was hidden -- Make `fly` executable if it was unregistered -- Restore the original permission if it was overridden - -### Multiple Command Resets -``` -/command reset luckperms -/command reset perms -/command reset lp -``` -Reset all LuckPerms-related commands to their original state. - -### Administrative Commands -``` -/command reset op -/command reset deop -/command reset stop -``` -Restore critical administrative commands to their default behavior. - -## Important Notes - -⚠️ **Warning:** 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 - -⚠️ **Warning:** Resetting commands that were unregistered for security reasons may expose them to all players again. - -💡 **Tip:** Use `/command permission query` before resetting to see what modifications are currently applied to a command. + + Resetting commands that were unregistered for security reasons may expose them to all players again. + ## Configuration Changes @@ -225,50 +55,8 @@ When you reset a command, Commander will: 4. Update the permission overrides list 5. Apply the changes immediately -## Verification - -After resetting a command, you can verify its state: - -``` -# Check if the command is visible and working -/fly - -# Check the permission (if any) -/command permission query fly - -# Try tab completion to see if it appears -/fly -``` - ## Tips - Use reset when you want to completely start over with a command - Consider the security implications of resetting unregistered commands -- Use `/command save` after resetting to ensure configuration is persisted -- Test the command after resetting to ensure it works as expected -- Keep track of which commands you reset for documentation purposes - -## Common Scenarios - -### Accidental Modifications -``` -# Oops! I accidentally hid the plugins command and set a wrong permission -/command reset plugins -# Now plugins is back to normal -``` - -### Testing Cleanup -``` -# After testing various command modifications -/command reset testcommand -/command reset experimental -# Clean slate for next test -``` - -### Security Review -``` -# Review and reset commands that were over-secured -/command reset help -/command reset spawn -# Make essential commands available again -``` \ No newline at end of file +- 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 index 87b459d..b53a5a2 100644 --- a/content/docs/commander/unregister-register.mdx +++ b/content/docs/commander/unregister-register.mdx @@ -13,8 +13,7 @@ Unlike hiding, unregistered commands cannot be executed by anyone. ### Unregister a Command Usage: `/command unregister ` -Completely removes a command from the server. -_Supports wildcards for bulk operations._ +Completely removes a command from the server. **Examples:** ``` @@ -33,16 +32,16 @@ _Supports wildcards for bulk operations._ /command unregister "*:*" ``` -### Register a Command + + 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._ + -``` -/command register -``` -Restores a previously unregistered command, making it available again. -_Supports wildcards for bulk operations._ +### Register a Command -**Parameters:** -- ``: The command to register (without the `/` prefix). Supports wildcards. +Usage: `/command register ` +Restores a previously unregistered command, making it available again. **Examples:** ``` @@ -60,71 +59,6 @@ _Supports wildcards for bulk operations._ /command register "*:*" ``` -## Permissions - -- `commander.admin` - Required to use both unregister and register commands - -## Behavior - -### Unregistered Commands -- Unregistered commands are **completely removed** from the server -- Unregistered commands cannot be executed by anyone, including administrators -- Unregistered commands don't appear in tab completion or help menus -- The command configuration is saved to a JSON file - -### Registered Commands - -- Previously unregistered commands become fully functional again -- All original permissions and behavior are restored -- The command appears in tab completions again (unless hidden) - -## Wildcard Support - -Commander supports powerful wildcard patterns for bulk command operations: - -### 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 - - - 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._ - - - - 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`._ - - -### Common Wildcard Examples - -``` -# Unregister ALL commands (use with caution!) -/command unregister "*" - -# Unregister all vanilla Minecraft commands -/command unregister "minecraft:*" - -# Unregister all Bukkit/Spigot/Paper commands -/command unregister "bukkit:*" -/command unregister "spigot:*" -/command unregister "paper:*" - -# Unregister all namespaced commands -/command unregister "*:*" - -# Unregister all commands starting with "admin" -/command unregister "admin*" - -# Unregister all commands ending with "list" -/command unregister "*list" -``` - ## Use Cases ### Security Hardening From dcf1cb7a66194c53505789f3c4c666e8251bdefc Mon Sep 17 00:00:00 2001 From: david Date: Sat, 1 Nov 2025 11:16:41 +0100 Subject: [PATCH 7/7] docs: update command registration and visibility titles --- content/docs/commander/hide-reveal.mdx | 2 +- content/docs/commander/unregister-register.mdx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/content/docs/commander/hide-reveal.mdx b/content/docs/commander/hide-reveal.mdx index 7045499..3c5da1f 100644 --- a/content/docs/commander/hide-reveal.mdx +++ b/content/docs/commander/hide-reveal.mdx @@ -1,5 +1,5 @@ --- -title: Hiding/Revealing Commands +title: Command Visibility description: Control command visibility in tab completion --- diff --git a/content/docs/commander/unregister-register.mdx b/content/docs/commander/unregister-register.mdx index b53a5a2..f185d67 100644 --- a/content/docs/commander/unregister-register.mdx +++ b/content/docs/commander/unregister-register.mdx @@ -1,9 +1,9 @@ --- -title: Un-/registering Commands +title: Command Registration description: Completely remove or restore commands from the server --- -# Un-/registering Commands +# Unregistering Commands Unregistering a command allows you to completely remove commands from the server. Unlike hiding, unregistered commands cannot be executed by anyone.