> 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/setup/how-it-works.md).

# How It Works

{% stepper %}
{% step %}

## Mods opt in

A mod author decides what servers may switch off when they write their WalksyLib config:

```java
Config.builder()
    .allowOptOutFromServer(disabled -> modDisabled = disabled)
    .allowOptOutFromServer("other-player-shields", disabled -> othersDisabled = disabled)
```

Here, servers may switch off the **whole mod** or the **`other-player-shields`** feature, and nothing else. See [Making Your Mod Controllable](/walksylib-docs/advanced/server-opt-out.md).
{% endstep %}

{% step %}

## The client reports

When a player with WalksyLib joins, their client tells the server which mods it has and what each one allows.

With `log-client-reports: true` in `config.yml`, each report is logged to the console.
{% endstep %}

{% step %}

## The server sends restrictions

The plugin works out which restrictions apply to the player:

* the **global** rule set, which applies to everyone
* every **rule set** in force for them, through their world, a permission, or being applied directly
* restrictions given to **them** directly

It sends these to the client, along with any reasons.
{% endstep %}

{% step %}

## The mod turns itself off

WalksyLib calls the mod's response for each restriction, and the mod switches off that feature. The player gets a notification:

> **This server turned off part of Shield Status**\
> other-player-shields: Not allowed in UHC

Whenever the player's restrictions change, for example when they change world, get a permission or have a rule set applied, the plugin sends the update right away.
{% endstep %}

{% step %}

## Leaving the server

When the player disconnects, everything is switched back on for them.&#x20;
{% endstep %}
{% endstepper %}

## Restriction IDs

A restriction is written as:

| Form            | Means                   |
| --------------- | ----------------------- |
| `modid`         | The whole mod           |
| `modid:feature` | One feature of that mod |

IDs are 1–64 characters of `a-z`, `0-9`, `_`, `.` or `-`, and are not case-sensitive.

{% hint style="warning" %}
The client applies restrictions itself. A modified client can ignore them. `/wlcontrol status` shows whether each player's client **allows** each restriction.
{% endhint %}
