|
| 1 | +--- |
| 2 | +title: Hiding/Revealing Commands |
| 3 | +description: Control command visibility in tab completion and help menus |
| 4 | +--- |
| 5 | + |
| 6 | +# Hiding and Revealing Commands |
| 7 | + |
| 8 | +Hiding commands allows you to control which commands appear in tab completion and help menus, |
| 9 | +creating a cleaner experience for players while still allowing the commands to be executed by those who know them. |
| 10 | + |
| 11 | +## Commands |
| 12 | + |
| 13 | +### Hide a Command |
| 14 | + |
| 15 | +Usage: `/command hide <command>` |
| 16 | +Hides a command from tab completion and help menus. Supports wildcards for bulk operations. |
| 17 | + |
| 18 | +**Examples:** |
| 19 | +``` |
| 20 | +<gray># Hide specific commands</gray> |
| 21 | +/command hide <aqua>plugins</aqua> |
| 22 | +/command hide <aqua>pl</aqua> |
| 23 | +
|
| 24 | +<gray># Hide all commands</gray> |
| 25 | +/command hide <aqua>*</aqua> |
| 26 | +
|
| 27 | +<gray># Hide all bukkit namespaced commands</gray> |
| 28 | +/command hide <aqua>bukkit:*</aqua> |
| 29 | +
|
| 30 | +<gray># Hide all namespaced commands</gray> |
| 31 | +/command hide <aqua>*:*</aqua> |
| 32 | +``` |
| 33 | + |
| 34 | +### Reveal a Command |
| 35 | +Usage: `/command reveal <command>` |
| 36 | +Makes a previously hidden command visible again in tab completion and help menus. Supports wildcards for bulk operations. |
| 37 | + |
| 38 | +**Examples:** |
| 39 | +``` |
| 40 | +<gray># Reveal specific commands</gray> |
| 41 | +/command reveal <aqua>plugins</aqua> |
| 42 | +/command reveal <aqua>pl</aqua> |
| 43 | +
|
| 44 | +<gray># Reveal all hidden commands</gray> |
| 45 | +/command reveal <aqua>*</aqua> |
| 46 | +
|
| 47 | +<gray># Reveal all bukkit namespaced commands</gray> |
| 48 | +/command reveal <aqua>bukkit:*</aqua> |
| 49 | +
|
| 50 | +<gray># Reveal all namespaced commands</gray> |
| 51 | +/command reveal <aqua>*:*</aqua> |
| 52 | +``` |
| 53 | + |
| 54 | +## Wildcard Support |
| 55 | + |
| 56 | +Commander supports powerful wildcard patterns for bulk command operations: |
| 57 | + |
| 58 | +### Wildcard Patterns |
| 59 | + |
| 60 | +- `*` - Matches any command name |
| 61 | +- `:*` - Matches any namespaced command (commands with colons) |
| 62 | +- `prefix:*` - Matches all commands with a specific namespace prefix |
| 63 | +- `*suffix` - Matches all commands ending with a specific suffix |
| 64 | + |
| 65 | +### Common Wildcard Examples |
| 66 | + |
| 67 | +``` |
| 68 | +<gray># Hide ALL commands (use with caution!)</gray> |
| 69 | +/command hide <aqua>*</aqua> |
| 70 | +
|
| 71 | +<gray># Hide all vanilla Minecraft commands</gray> |
| 72 | +/command hide <aqua>minecraft:*</aqua> |
| 73 | +
|
| 74 | +<gray># Hide all Bukkit/Spigot commands</gray> |
| 75 | +/command hide <aqua>bukkit:*</aqua> |
| 76 | +
|
| 77 | +<gray># Hide all plugin commands (namespaced)</gray> |
| 78 | +/command hide <aqua>*:*</aqua> |
| 79 | +
|
| 80 | +<gray># Hide all commands starting with "admin"</gray> |
| 81 | +/command hide <aqua>admin*</aqua> |
| 82 | +
|
| 83 | +<gray># Hide all commands ending with "list"</gray> |
| 84 | +/command hide <aqua>*list</aqua> |
| 85 | +``` |
| 86 | + |
| 87 | +### Wildcard Use Cases |
| 88 | + |
| 89 | +#### Complete Command Cleanup |
| 90 | +``` |
| 91 | +<gray># Hide all namespaced commands (usually plugin commands)</gray> |
| 92 | +/command hide <aqua>*:*</aqua> |
| 93 | +
|
| 94 | +<gray># Then selectively reveal essential ones</gray> |
| 95 | +/command reveal <aqua>essentials:*</aqua> |
| 96 | +/command reveal <aqua>luckperms:*</aqua> |
| 97 | +``` |
| 98 | + |
| 99 | +#### Plugin Management |
| 100 | +``` |
| 101 | +<gray># Hide all commands from a specific plugin</gray> |
| 102 | +/command hide <aqua>worldedit:*</aqua> |
| 103 | +
|
| 104 | +<gray># Hide all administrative commands</gray> |
| 105 | +/command hide <aqua>admin*</aqua> |
| 106 | +/command hide <aqua>*admin</aqua> |
| 107 | +``` |
| 108 | + |
| 109 | +#### Server Type Filtering |
| 110 | +``` |
| 111 | +<gray># Hide all creative mode commands on a survival server</gray> |
| 112 | +/command hide <aqua>fly</aqua> |
| 113 | +/command hide <aqua>gamemode</aqua> |
| 114 | +/command hide <aqua>worldedit:*</aqua> |
| 115 | +``` |
| 116 | + |
| 117 | +### Important Notes |
| 118 | + |
| 119 | +⚠️ **Warning:** Using `/command hide *` will hide literally ALL commands, including essential ones like `/command` itself. Make sure you have alternative access to restore commands. |
| 120 | + |
| 121 | +⚠️ **Warning:** Wildcard operations affect many commands at once. Test carefully and consider using `/command save` before bulk operations. |
| 122 | + |
| 123 | +💡 **Tip:** Use `/command reveal *` to quickly restore all hidden commands. |
| 124 | + |
| 125 | +💡 **Tip:** Combine wildcards with specific commands for fine-tuned control. |
| 126 | + |
| 127 | +## Behavior |
| 128 | + |
| 129 | +### Hidden Commands |
| 130 | +- Hidden commands are **still executable** by players who know the command |
| 131 | +- Hidden commands don't appear in tab completion |
| 132 | +- Hidden commands don't appear in help menus (`/help`, `/?`) |
| 133 | +- The command configuration is saved to a JSON file |
| 134 | + |
| 135 | +### Bypass Permission |
| 136 | +Players with the `commander.bypass` permission can see all hidden commands, regardless of other permissions. |
| 137 | + |
| 138 | +**Important:** Wildcard permissions (like `*`) are ignored for the bypass permission. Players must have the explicit `commander.bypass` permission to see hidden commands. |
| 139 | + |
| 140 | +## Use Cases |
| 141 | + |
| 142 | +### Clean Command Lists |
| 143 | +Hide administrative or utility commands that regular players shouldn't see: |
| 144 | +``` |
| 145 | +/command hide <aqua>plugins</aqua> |
| 146 | +/command hide <aqua>pl</aqua> |
| 147 | +/command hide <aqua>version</aqua> |
| 148 | +/command hide <aqua>ver</aqua> |
| 149 | +``` |
| 150 | + |
| 151 | +### Server-Specific Commands |
| 152 | +Hide commands that are only relevant to certain server types or gamemodes. |
| 153 | + |
| 154 | +### Development Commands |
| 155 | +Hide debugging or development commands from production environments. |
| 156 | + |
| 157 | +## Configuration |
| 158 | + |
| 159 | +Hidden commands are stored in a JSON configuration file. The file contains a simple array of command names that should be hidden. |
| 160 | + |
| 161 | +`hidden-commands.json`: |
| 162 | +```json |
| 163 | +[ |
| 164 | + "plugins", |
| 165 | + "pl", |
| 166 | + "version", |
| 167 | + "ver" |
| 168 | +] |
| 169 | +``` |
| 170 | + |
| 171 | +## Tips |
| 172 | + |
| 173 | +- Commands are hidden without the `/` prefix in the configuration |
| 174 | +- Both the full command name and aliases should be hidden if desired |
| 175 | +- Use `/command reload` to reload the configuration if manually edited |
0 commit comments