> For the complete documentation index, see [llms.txt](https://docs.aethercube.fr/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.aethercube.fr/developers/plugins/gameplay-registries.md). Agents can also search and read this documentation through its [MCP server](https://docs.aethercube.fr/~gitbook/mcp).

# Gameplay registries

`Server` exposes the gameplay systems as registries. This page is the map: what each one is and what a plugin can do with it. Items, creatures, biomes, generators, the loading screen and screen effects have their own pages. For the exact signatures, the javadoc of `server-api` is the reference.

All of these calls belong to the simulation thread unless a page or a section says otherwise. `access()` is the exception: it may be called from any thread.

| Accessor            | Type                | Purpose                                                                                                    |
| ------------------- | ------------------- | ---------------------------------------------------------------------------------------------------------- |
| `abilities()`       | `AbilityRegistry`   | Abilities and player loadouts.                                                                             |
| `bosses()`          | `Bosses`            | Boss definitions and live bosses.                                                                          |
| `effects()`         | `EffectRegistry`    | Status effects.                                                                                            |
| `progression()`     | `Progression`       | Levels and experience.                                                                                     |
| `containers()`      | `Containers`        | Chests, forges and custom containers.                                                                      |
| `npcs()`            | `Npcs`              | NPC types, shops and live NPCs.                                                                            |
| `quests()`          | `Quests`            | Quest definitions and player quest state.                                                                  |
| `creativeCatalog()` | `CreativeCatalog`   | The creative menu.                                                                                         |
| `smelting()`        | `Smelting`          | Forge recipes and fuels.                                                                                   |
| `lootTables()`      | `LootTableRegistry` | Loot tables.                                                                                               |
| `structures()`      | `StructureRegistry` | Structures.                                                                                                |
| `permissions()`     | `Permissions`       | See [Commands and permissions](https://docs.aethercube.fr/developers/plugins/commands-and-permissions.md). |
| `access()`          | `AccessControl`     | The whitelist, account bans and address bans. See [Access control](#access-control).                       |

## Abilities

An ability has a key and a number of slots: `AbilityRegistry.SLOTS` is 4.

| Method                                         | Effect                            |
| ---------------------------------------------- | --------------------------------- |
| `register(owner, ability)`                     | Add an ability.                   |
| `get(key)`, `all()`                            | Read abilities.                   |
| `defaultLoadout()`                             | The default slot to ability map.  |
| `loadout(player)`, `setLoadout(player, slots)` | Read or set a player's loadout.   |
| `unregisterAll(owner)`                         | Remove the abilities of a plugin. |

`AbilityCastEvent` lets a plugin refuse a cast.

## Status effects

`register(owner, effect)` adds a `StatusEffect`. `apply`, `remove`, `clear` and `active` work on entities. See [Players, entities and creatures](https://docs.aethercube.fr/developers/plugins/players-entities-creatures.md).

## Progression

`level(player)`, `experience(player)`, `giveExperience(player, amount)` and `setLevel(player, level)`. `ExperienceGainEvent` and `LevelUpEvent` observe the changes.

## Bosses

`bosses().registry()` holds boss definitions. `spawn(definition, world, position)` spawns a boss (`Optional` result), `live()` lists the bosses and `remove(boss)` removes one. Arenas of the default world are set in `server.yml`. See [server.yml reference](https://docs.aethercube.fr/developers/running-a-server/configuration-reference.md).

## NPCs, shops and quests

| Call                                                       | Effect                                                                  |
| ---------------------------------------------------------- | ----------------------------------------------------------------------- |
| `npcs().registry()`                                        | NPC type definitions.                                                   |
| `npcs().shops()`                                           | Shop definitions.                                                       |
| `npcs().spawn(type, world, feet)`                          | Place an NPC.                                                           |
| `npcs().live()`, `remove(npc)`                             | List and remove NPCs.                                                   |
| `quests().registry()`                                      | Quest definitions.                                                      |
| `quests().state(player, quest)`, `progress(player, quest)` | Read quest state.                                                       |
| `quests().start`, `complete`, `reset`                      | Change quest state. Each takes `(player, quest)` and returns a boolean. |

NPCs are not saved. A plugin places them again at every start. The events are `NpcInteractEvent`, `ShopTradeEvent`, `QuestStartEvent`, `QuestProgressEvent` and `QuestCompleteEvent`.

## Containers

| Method                                             | Effect                                                                      |
| -------------------------------------------------- | --------------------------------------------------------------------------- |
| `create(title, slotCount)`                         | Make a container that is not open. Up to `Containers.MAX_SLOTS` (54) slots. |
| `open(player, title, slotCount)`                   | Make a container and open it for a player.                                  |
| `open(player, container)`                          | Open an existing container. Returns whether it opened.                      |
| `release(container)`                               | Free a container you created.                                               |
| `chest(world, position)`, `forge(world, position)` | The container of a block, if there is one.                                  |
| `openContainer(player)`                            | The container a player has open.                                            |
| `close(player)`                                    | Close it.                                                                   |
| `lootTables()`                                     | The loot tables.                                                            |

## Access control

`getServer().access()` returns the `AccessControl` of the server: the whitelist, the account bans and the address bans. They are the same lists that `/whitelist`, `/ban`, `/ban-ip`, `/pardon`, `/pardon-ip` and `/banlist` change. The rules and the files are in [Whitelist and bans](https://docs.aethercube.fr/developers/running-a-server/whitelist-and-bans.md). The interface is in `com.velyorix.game.api.access` and is available from `onLoad` on.

| Method                                     | Effect                                                                                                                  |
| ------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------- |
| `whitelistEnforced()`                      | Whether the whitelist is on. When it is off its entries are kept but ignored.                                           |
| `setWhitelistEnforced(enforced, by)`       | Turn it on or off.                                                                                                      |
| `isWhitelisted(uuid, name)`                | Whether the player may join under the whitelist. Always true while it is off.                                           |
| `whitelistAdd(name, uuid, by)`             | Add a player. Returns `false` when already listed. `uuid` may be `null`.                                                |
| `whitelistRemove(name, by)`                | Remove a player by name. Returns `false` when not listed.                                                               |
| `whitelist()`                              | The entries, sorted by name: `WhitelistEntry(name, uuid, addedBy, addedAt)`.                                            |
| `ban(name, uuid, reason, expires, by)`     | Ban an account and return the `Ban`. Replaces an earlier ban. `reason` may be `null`, `expires` `null` means permanent. |
| `pardon(name, by)`                         | Lift a ban by name. Returns `false` when the player was not banned.                                                     |
| `isBanned(uuid, name)`                     | Whether the account is banned now.                                                                                      |
| `banOf(uuid, name)`                        | The active `Optional<Ban>`: `Ban(name, uuid, reason, source, created, expires)`.                                        |
| `bans()`                                   | The active account bans, sorted by name.                                                                                |
| `banAddress(address, reason, expires, by)` | Ban an IPv4 or IPv6 literal and return the `IpBan`. Throws `IllegalArgumentException` for anything else.                |
| `pardonAddress(address, by)`               | Lift an address ban. Returns `false` when it was not banned.                                                            |
| `isAddressBanned(address)`                 | Whether the address is banned now. A string that is not an IP literal is never banned.                                  |
| `addressBans()`                            | The active address bans, sorted by address: `IpBan(address, reason, source, created, expires)`.                         |

```java
AccessControl access = getServer().access();

// A ban by name: the player has never been seen, so there is no UUID yet.
access.ban("Troll", null, "griefing", Instant.now().plus(Duration.ofDays(7)), "MyPlugin");
access.isBanned(null, "troll");                       // true: no UUID, so by name
access.pardon("Troll", "MyPlugin");

access.banAddress("203.0.113.9", "spam", null, "MyPlugin");   // null: permanent
access.whitelistAdd("Bob", null, "MyPlugin");
access.setWhitelistEnforced(true, "MyPlugin");
```

* `by` is the author recorded in the file and in the log: `console`, a player name, or your plugin's name.
* Names are compared without regard to case. An entry added with a `null` UUID gets the account's UUID the first time that player is checked, and from then on follows the account, not the name.
* A ban whose `expires` is in the past is gone at the next check. `bans()` and `addressBans()` list the active ones.
* A change that makes a connected player unwelcome (`ban`, `banAddress`, `setWhitelistEnforced(true, ...)`, `whitelistRemove`) disconnects that player with the wire reason `BANNED` and a text such as `banned until 2026-12-24 18:00 UTC: griefing`. The server does it on the simulation thread, shortly after your call returns. Call them from the simulation thread when a connected player must be gone at once.
* **Threads.** The queries and the changes may be called from any thread. The lists are guarded by one lock, so a change is visible to the next query. The files are written on a separate thread, never on yours, and a write that fails is logged.

## Creative menu

```java
getServer().creativeCatalog().registerCategory(
        this, new NamespacedKey("skyglass", "glass"), "Driftglass",
        new NamespacedKey("skyglass", "drift_shard"), 100);
getServer().creativeCatalog().addItem(
        this, new NamespacedKey("skyglass", "glass"), new NamespacedKey("skyglass", "drift_shard"));
```

`registerCategory(owner, id, name, iconItem, order)` and `addItem(owner, categoryId, itemKey)`. `removeItem` and `unregisterAll(owner)` undo them.

## Smelting

Assume the plugin registered an item `skyglass:clear_pane`.

```java
getServer().smelting().addRecipe(this, new Smelting.Recipe(
        "skyglass:shard_to_pane",
        new NamespacedKey("skyglass", "drift_shard"),
        new NamespacedKey("skyglass", "clear_pane"),
        1, 200));
getServer().smelting().addFuel(this, new Smelting.Fuel("skyglass:drift_shard", 400));
```

`Recipe(id, input, output, outputCount, ticks)`, `Fuel(itemId, burnTicks)`. Read with `recipes()`, `fuels()`, `recipeFor(input)` and `burnTicks(item)`. Remove with `removeRecipe(owner, id)` and `removeFuel(owner, itemId)`.

The server does not expose crafting recipes, crafting stations or repair rules to plugins.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.aethercube.fr/developers/plugins/gameplay-registries.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
