# IScreenManager
> Manages screen-level effects for players running the Lectern client.
`gg.lode.lecternapi.api.manager.IScreenManager`
---
## Signature
```java
public interface IScreenManager
```
---
## Methods
### flash
```java
void flash(Player player, int red, int green, int blue, int alpha, int layer, float durationIn, float durationStay, float durationOut)
```
Triggers a screen flash effect on the player's client.
| Parameter | Type | Description |
|---|---|---|
| `player` | `Player` | The target player. |
| `red` | `int` | Red component (0-255). |
| `green` | `int` | Green component (0-255). |
| `blue` | `int` | Blue component (0-255). |
| `alpha` | `int` | Alpha component (0-255). |
| `layer` | `int` | The render layer. |
| `durationIn` | `float` | Fade-in duration in seconds. |
| `durationStay` | `float` | Stay duration in seconds. |
| `durationOut` | `float` | Fade-out duration in seconds. |
---
### setXray
```java
void setXray(Player player, boolean enabled, int range)
```
Enables or disables the xray effect on the player's client.
| Parameter | Type | Description |
|---|---|---|
| `player` | `Player` | The target player. |
| `enabled` | `boolean` | Whether to enable xray. |
| `range` | `int` | The render range in blocks (only used when enabling). |
---
### addXrayBlock
```java
void addXrayBlock(Player player, String material, int red, int green, int blue)
```
Adds a block type to the xray highlight list.
| Parameter | Type | Description |
|---|---|---|
| `player` | `Player` | The target player. |
| `material` | `String` | The block identifier (e.g. `"minecraft:iron_ore"`). |
| `red` | `int` | Red highlight color (0-255). |
| `green` | `int` | Green highlight color (0-255). |
| `blue` | `int` | Blue highlight color (0-255). |
---
### removeXrayBlock
```java
void removeXrayBlock(Player player, String material)
```
Removes a block type from the xray highlight list.
| Parameter | Type | Description |
|---|---|---|
| `player` | `Player` | The target player. |
| `material` | `String` | The block identifier to remove. |
---
### setPreventDisconnect
```java
void setPreventDisconnect(Player player, boolean enabled)
```
Prevents the player from disconnecting or opening the pause menu.
| Parameter | Type | Description |
|---|---|---|
| `player` | `Player` | The target player. |
| `enabled` | `boolean` | `true` to prevent disconnection. |
---
### forceShader
```java
void forceShader(Player player, String shaderName)
```
Forces a shader pack on the player's client. The shader pack must be available as a ZIP file at `assets/lectern/shader-templates/<shaderName>.zip`, either bundled in the Lectern mod or provided via a server resource pack. While active, the player cannot switch away from the forced shader.
| Parameter | Type | Description |
|---|---|---|
| `player` | `Player` | The target player. |
| `shaderName` | `String` | The shader pack name (e.g. `"backrooms"`). |
---
### stopForceShader
```java
void stopForceShader(Player player)
```
Stops forcing a shader pack on the player's client and disables shaders.
| Parameter | Type | Description |
|---|---|---|
| `player` | `Player` | The target player. |
---
### startMotionBlur
```java
void startMotionBlur(Player player, float intensity)
```
Enables the motion blur effect with the specified intensity.
| Parameter | Type | Description |
|---|---|---|
| `player` | `Player` | The target player. |
| `intensity` | `float` | The blur intensity (0.0 to 1.0). |
---
### stopMotionBlur
```java
void stopMotionBlur(Player player)
```
Disables the motion blur effect.
| Parameter | Type | Description |
|---|---|---|
| `player` | `Player` | The target player. |
---
### setOutlineShader
```java
void setOutlineShader(Player player, boolean enabled)
```
Enables or disables the outline shader (motion sense) effect.
| Parameter | Type | Description |
|---|---|---|
| `player` | `Player` | The target player. |
| `enabled` | `boolean` | `true` to enable the outline shader. |
---
### showModalPrompt
```java
void showModalPrompt(Player player, String promptId, String title, String content, List<ModalPromptButton> buttons)
```
Displays a modal prompt on the player's client with a title, markdown content, and configurable buttons. The modal blocks all player input until a button is clicked.
| Parameter | Type | Description |
|---|---|---|
| `player` | `Player` | The target player. |
| `promptId` | `String` | A unique identifier for this prompt instance. |
| `title` | `String` | The window title. |
| `content` | `String` | Markdown-formatted body text. Supports `#`, `##`, `###` headers, `---` separators, `- ` bullet lists, and `**bold**` text. |
| `buttons` | `List<ModalPromptButton>` | The list of buttons to display. See [[ModalPromptButton]]. |
---
### closeModalPrompt
```java
void closeModalPrompt(Player player)
```
Closes any currently displayed modal prompt on the player's client.
| Parameter | Type | Description |
|---|---|---|
| `player` | `Player` | The target player. |
---
### setSwapHands
```java
void setSwapHands(Player viewer, UUID target, boolean enabled)
```
Swaps the visual rendering of a target player's main hand and off hand items as seen by the viewer. This is purely visual — it does not affect gameplay or actual item slots.
| Parameter | Type | Description |
|---|---|---|
| `viewer` | `Player` | The player whose client will render the swap. |
| `target` | `UUID` | The UUID of the player whose hands should appear swapped. |
| `enabled` | `boolean` | `true` to enable the swap effect. |
---
### clearSwapHands
```java
void clearSwapHands(Player viewer)
```
Clears all swap hand effects for the viewer.
| Parameter | Type | Description |
|---|---|---|
| `viewer` | `Player` | The player whose swap effects should be cleared. |
---
## Related Pages
- [[ILecternAPI]] — Access via `getScreenManager()`
- [[ModalPromptButton]] — Button configuration for modal prompts
- [[ModalPromptClickEvent]] — Fired when a CONSUMER button is clicked