> 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/ui.md). Agents can also search and read this documentation through its [MCP server](https://docs.aethercube.fr/~gitbook/mcp).

# UI: loading screens and screen effects

Two things a plugin can do with what the player sees: change the loading screen, and play a full-screen shader effect. You need this page if you want a per-player welcome screen or an atmosphere effect.

## Loading screens

`server.loadingScreens()` holds the server-wide default, which starts as the `loading_screen` section of `server.yml`.

| Method                | Meaning                                                |
| --------------------- | ------------------------------------------------------ |
| `defaults()`          | The current default `LoadingScreen`.                   |
| `setDefaults(screen)` | Replace it. It applies to players who join afterwards. |

A `LoadingScreen` is immutable. Build one with `LoadingScreen.builder()` or change the current one with `toBuilder()`:

```java
LoadingScreens screens = getServer().loadingScreens();
screens.setDefaults(screens.defaults().toBuilder()
        .title("Emberhold")
        .subtitle("A server for the long road")
        .tip("Waystones stand on the ley lines.")
        .tipSeconds(8)
        .accentRgb(0xE07A2F)
        .backdrop("aethercube:frostveil")
        .build());
```

| Builder method                  | Limit                                                                                        |
| ------------------------------- | -------------------------------------------------------------------------------------------- |
| `title(text)`                   | 48 characters.                                                                               |
| `subtitle(text)`                | 120 characters.                                                                              |
| `tips(collection)`, `tip(text)` | 16 tips of 160 characters.                                                                   |
| `tipSeconds(n)`                 | `0` for the client's default, otherwise clamped to 3 to 30.                                  |
| `accentRgb(rgb)`                | The low 24 bits. `0` means the client's default.                                             |
| `backdrop(id)`                  | 64 characters. A built-in or pack backdrop id. Empty rotates through the client's backdrops. |

The builder never throws for a long or odd string. It clips the text to the limits, counting characters as code points, and strips control characters. A `null` argument throws `NullPointerException`. An empty value means "the client's default".

Built-in backdrops are listed in [Loading screen](https://docs.aethercube.fr/developers/running-a-server/loading-screen.md).

### One screen per player

`PlayerLoadingScreenEvent` fires once per join on the simulation thread, after the connection is accepted and before the world is sent. It starts with the server default. A listener replaces it for that player only:

```java
@EventHandler
public void onLoading(PlayerLoadingScreenEvent event) {
    event.setScreen(event.screen().toBuilder()
            .subtitle("Welcome back, " + event.player().displayName())
            .build());
}
```

The player has no entity yet: `event.player().entity()` is `null`.

## Screen effects

A screen effect is a full-screen shader a content pack declares. A plugin shows it to one player.

```java
ScreenEffect updraft = ScreenEffect.builder()
        .effect("skyglass:updraft")
        .intensity(0.8f)
        .params(1.0f)
        .fadeSeconds(1.5f)
        .build();

getServer().screenEffects().show(player, updraft);
```

| Builder method                 | Meaning                                                                                           |
| ------------------------------ | ------------------------------------------------------------------------------------------------- |
| `effect(id)`                   | The effect id, `namespace:name`, 64 characters at most. An empty id turns the current effect off. |
| `intensity(x)`                 | Strength, clamped to 0..1. Default 1.                                                             |
| `params(float...)`, `param(x)` | Up to 8 numbers handed to the shader.                                                             |
| `fadeSeconds(s)`               | Fade in or out, clamped to 0..10 seconds.                                                         |

`ScreenEffect.of(id)` builds one with the defaults and `ScreenEffect.NONE` turns the effect off.

| Call                                   | Meaning                                              |
| -------------------------------------- | ---------------------------------------------------- |
| `screenEffects().show(player, effect)` | Show or replace the effect for one player.           |
| `screenEffects().clear(player)`        | Remove it.                                           |
| `contentPacks().screenEffects()`       | The set of effect ids that the loaded packs declare. |

Both calls are safe from any thread. `show` throws `IllegalArgumentException` for a non-empty id that no loaded pack declares, so check `contentPacks().screenEffects().contains(id)` first. A pack may be absent: `content_packs.enabled` can be off and a pack can be refused.

To turn an effect off with a fade, show an effect with an empty id and a fade time:

```java
getServer().screenEffects().show(player,
        ScreenEffect.builder().effect("").fadeSeconds(1.5f).build());
```

A shader receives `intensity` (already faded), `time`, the resolution and the 8 parameters, packed as two `vec4<f32>`. See [Shaders](https://docs.aethercube.fr/developers/content-packs/shaders.md).


---

# 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/ui.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.
