> For the complete documentation index, see [llms.txt](https://walksy.gitbook.io/walksylib-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://walksy.gitbook.io/walksylib-docs/walksylibservermanager/using/rule-sets.md).

# Rule Sets

A **rule set** is a named list of restrictions, for example one per gamemode or kit: `uhc`, `nethpot`, `vanilla`.

The **global** rule set is special: it applies to everyone. Plain `disable`/`enable` edit it. On top of that, a player gets every rule set that is:

| Tied to          | How                              | Applies while                                                     |
| ---------------- | -------------------------------- | ----------------------------------------------------------------- |
| **A world**      | `ruleset <id> world add <world>` | the player is in that world                                       |
| **A permission** | `ruleset <id> permission <node>` | the player has that permission (checked on join and world change) |
| **The player**   | `player <player> apply <id>`     | until it's removed or the player leaves                           |

## Creating a rule set

```
/wlcontrol ruleset create uhc
/wlcontrol ruleset uhc disable shieldstatus
/wlcontrol ruleset uhc disablewithreason crosshairaddons hitmarker "Not in UHC"
```

Rule set IDs are 1–64 characters of `a-z`, `0-9`, `_` or `-`, and can't be `global`, `list`, `create` or `delete`.

Editing works like the global commands: `disable`, `disablewithreason`, `enable`, `enablewithreason`, including `enable <modId> *`.

## Tying it to worlds

```
/wlcontrol ruleset uhc world add uhc_1
/wlcontrol ruleset uhc world add uhc_2
/wlcontrol ruleset uhc world remove uhc_2
```

You can add a world that isn't loaded yet. The rule set applies once it is.

## Tying it to a permission

```
/wlcontrol ruleset uhc permission server.gamemode.uhc
/wlcontrol ruleset uhc permission none
```

Each rule set can be tied to one permission. `none` removes it.

## Applying it from another plugin

Many minigame plugins can run console commands when a player joins or leaves an arena:

```
/wlcontrol player %player% apply uhc
/wlcontrol player %player% remove uhc
```

For a proper integration, see the [Rule Sets API](/walksylib-docs/walksylibservermanager/developers/rule-sets-api.md).

## Managing rule sets

```
/wlcontrol ruleset list                 every rule set, with a summary
/wlcontrol ruleset uhc                  what uhc switches off and where it applies
/wlcontrol ruleset uhc clear            remove all of uhc's restrictions
/wlcontrol ruleset delete uhc
```

The global rule set can't be deleted, but `/wlcontrol ruleset global clear` empties it.

## Example: a UHC world

```
/wlcontrol ruleset create uhc
/wlcontrol ruleset uhc disablewithreason shieldstatus other-player-shields "Not in UHC"
/wlcontrol ruleset uhc disable customhitboxes
/wlcontrol ruleset uhc world add uhc_1
```

Anyone in `uhc_1` now has those features off. They come back when the player leaves the world.
