Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
103 changes: 103 additions & 0 deletions content/docs/commander/hide-reveal.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
---
title: Command Visibility
description: Control command visibility in tab completion
---

# Hiding and Revealing Commands

Hiding commands allows you to control which commands appear in tab completion,
creating a cleaner experience for players while still allowing the commands to be executed by those who know them.

## Commands

### Hide a Command

Usage: `/command hide <command>`
Hides a command from tab completion.

**Examples:**
```
<gray># Hide specific commands</gray>
/command hide <aqua>plugins</aqua>
/command hide <aqua>pl</aqua>

<gray># Hide all commands</gray>
/command hide <aqua>"*"</aqua>

<gray># Hide all bukkit namespaced commands</gray>
/command hide <aqua>"bukkit:*"</aqua>

<gray># Hide all namespaced commands</gray>
/command hide <aqua>"*:*"</aqua>
```

<Callout type="warning">
Using `/command hide "*"` will hide literally **ALL** commands, including `/command` itself.
Use `/command reveal "*"` to quickly restore all hidden commands.
</Callout>

### Reveal a Command
Usage: `/command reveal <command>`
Makes a previously hidden command visible again in tab completions.

**Examples:**
```
<gray># Reveal specific commands</gray>
/command reveal <aqua>plugins</aqua>
/command reveal <aqua>pl</aqua>

<gray># Reveal all hidden commands</gray>
/command reveal <aqua>"*"</aqua>

<gray># Reveal all bukkit namespaced commands</gray>
/command reveal <aqua>"bukkit:*"</aqua>

<gray># Reveal all namespaced commands</gray>
/command reveal <aqua>"*:*"</aqua>
```

## Bypass Permission
Players with the `commander.bypass` permission can see all hidden commands.

<Callout type="info">
Wildcard permissions (like `*`) are ignored for the bypass permission.
Players must have the explicit `commander.bypass` permission to see hidden commands.
</Callout>

## Use Cases

### Clean Command Lists
Hide administrative or utility commands that regular players shouldn't see:
```
/command hide <aqua>plugins</aqua>
/command hide <aqua>pl</aqua>
/command hide <aqua>version</aqua>
/command hide <aqua>ver</aqua>
```

### 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
121 changes: 120 additions & 1 deletion content/docs/commander/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,123 @@ description: Manage command visibility and permissions
icon: BookMarked
---

Coming soon!
# Commander

Commander is a powerful Minecraft server plugin that gives you complete control over command visibility,
permissions, and registration.
Clean up your command list, enhance security, and customize your server's command experience.

## Features

### Command Management

- **Hide Commands**: Control which commands appear in tab completion
- **Unregister Commands**: Completely remove commands from the server

### Permission Control

- **Override Permissions**: Set custom permissions on any command
- **Query Permissions**: Check current permission settings
- **Add Security**: Restrict commands that originally had no permissions

### Configuration

- **JSON Configuration**: Simple, human-readable configuration files
- **Hot Reload**: Apply changes without server restart
- **Manual Editing**: Direct configuration file access

## Quick Start

### Basic Usage

The main command of Commander is `/command` (or `/commandv` on the proxy),
and requires the permission `commander.admin`:

```
<gray># Hide commands from players</gray>
/command hide <aqua>plugins</aqua>
/command hide <aqua>pl</aqua>

<gray># Add permissions to unrestricted commands</gray>
/command permission set <aqua>luckperms</aqua> <yellow>luckperms.use</yellow>

<gray># Remove dangerous commands entirely</gray>
/command unregister <aqua>op</aqua>
/command unregister <aqua>deop</aqua>

<gray># Save your changes (not required)</gray>
/command save
```

### Common Scenarios

#### Clean Command List

Hide administrative commands from regular players:
```
/command hide <aqua>plugins</aqua>
/command hide <aqua>version</aqua>
```

#### Security Hardening

Remove dangerous commands:
```
/command unregister <aqua>op</aqua>
/command unregister <aqua>deop</aqua>
```

#### Plugin Integration

Add permissions to plugin commands that lack them:
```
/command permission set <aqua>luckperms</aqua> <yellow>luckperms.use</yellow>
/command permission set <aqua>eco</aqua> <yellow>economy.admin</yellow>
```

## Permission System

### Required Permissions

- `commander.admin` - Access to all Commander commands
- `commander.bypass` - See hidden commands (wildcard permissions ignored)

### Permission Override

Commander can override permissions on (almost) any command, even those from other plugins.
This allows you to:
- Add permissions to unrestricted commands
- Change existing permissions
- Create world-specific or group-specific command access

## Wildcard Support

Commander supports powerful wildcard patterns for bulk operations on commands:

### Wildcard Patterns

- `*` - Matches any command name
- `*:*` - Matches any namespaced command (commands with colons)
- `prefix:*` - Matches all commands with a specific namespace prefix
- `*suffix` - Matches all commands ending with a specific suffix

<Callout type="warning">
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`._
</Callout>

## 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
5 changes: 5 additions & 0 deletions content/docs/commander/meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
"index",
"faq",
"---Guide---",
"hide-reveal",
"unregister-register",
"permissions",
"reset",
"reload-save",
"---For Developers---",
"api/repository",
"api/index"
Expand Down
Loading