# 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. | --- ### requestScreenshot ```java void requestScreenshot(Player player) ``` Requests a screenshot from the player's client. The screenshot is captured silently and uploaded back to the server in chunks. When the transfer completes, a `ClientScreenshotEvent` is fired with the saved file. | Parameter | Type | Description | |---|---|---| | `player` | `Player` | The target player. | --- ### showHandPose ```java void showHandPose(Player player, String itemId, float spinSpeed, float bobSpeed, float bobHeight) ``` Displays the player's hand held out with an item floating and spinning above it. If `itemId` is empty, the player's currently held item is used. | Parameter | Type | Description | |---|---|---| | `player` | `Player` | The target player. | | `itemId` | `String` | The item identifier (e.g. `"minecraft:diamond_sword"`), or empty string to use held item. | | `spinSpeed` | `float` | Spin speed multiplier (1.0 = default). | | `bobSpeed` | `float` | Vertical bob speed multiplier (1.0 = default). | | `bobHeight` | `float` | Vertical bob amplitude (0.03 = default). | ```java void showHandPose(Player player) ``` Convenience overload that uses the player's held item with default animation values (spinSpeed=2.0, bobSpeed=1.5, bobHeight=0.03). --- ### stopHandPose ```java void stopHandPose(Player player) ``` Stops the hand pose effect. | Parameter | Type | Description | |---|---|---| | `player` | `Player` | The target player. | --- ### playHandAnimation ```java void playHandAnimation(Player player, String animationName, String itemId, boolean loop, float speed) ``` Plays a named hand animation on the player's client. The animation must be loaded via resource pack (`assets/lectern/animations/`) or previously sent inline via `loadInlineHandAnimation`. See [[Hand Animations]] for the full animation system guide. | Parameter | Type | Description | |---|---|---| | `player` | `Player` | The target player. | | `animationName` | `String` | The animation identifier (e.g. `"animation.hand.inspect"`). | | `itemId` | `String` | The item to display, or empty string to use held item. | | `loop` | `boolean` | Whether the animation should loop (overrides the animation's own loop setting). | | `speed` | `float` | Playback speed multiplier (1.0 = normal). | ```java void playHandAnimation(Player player, String animationName) ``` Convenience overload that uses the held item with default speed and no looping. --- ### stopHandAnimation ```java void stopHandAnimation(Player player) ``` Stops the currently playing hand animation. | Parameter | Type | Description | |---|---|---| | `player` | `Player` | The target player. | --- ### crossfadeHandAnimation ```java void crossfadeHandAnimation(Player player, String animationName, float blendDuration, float speed) ``` Crossfades from the current hand animation to a new one over the specified duration. The current animation's transforms are frozen and blended into the new animation. | Parameter | Type | Description | |---|---|---| | `player` | `Player` | The target player. | | `animationName` | `String` | The animation to transition to. | | `blendDuration` | `float` | Blend duration in seconds. | | `speed` | `float` | Playback speed multiplier. | --- ### loadInlineHandAnimation ```java void loadInlineHandAnimation(Player player, String animationName, String animationJson) ``` Sends a Bedrock animation JSON directly to the player's client, making it available for playback without requiring a resource pack. See [[Hand Animations]] for the JSON format specification. | Parameter | Type | Description | |---|---|---| | `player` | `Player` | The target player. | | `animationName` | `String` | The name to register the animation under. | | `animationJson` | `String` | The full Bedrock animation JSON string. | --- ### setCarry ```java void setCarry(Player viewer, UUID target, boolean enabled) ``` Sets the carry pose on a target player as seen by the viewer. The target player's arms will be raised above their head as if carrying a crate. This is purely visual and does not affect gameplay. | Parameter | Type | Description | |---|---|---| | `viewer` | `Player` | The player whose client will render the carry pose. | | `target` | `UUID` | The UUID of the player who should appear carrying. | | `enabled` | `boolean` | `true` to enable the carry pose. | --- ### clearCarry ```java void clearCarry(Player viewer) ``` Clears all carry poses for the viewer. | Parameter | Type | Description | |---|---|---| | `viewer` | `Player` | The player whose carry effects should be cleared. | --- ### setFreezePlayerBody ```java void setFreezePlayerBody(Player viewer, UUID target, boolean enabled) ``` Freezes a target player's body movement as seen by the viewer. The target's body pose is captured on the first frame after freezing, and all limb animations and body rotation are locked to that pose. The player can still move — only the visual pose is frozen. This is purely visual on the viewer's client. | Parameter | Type | Description | |---|---|---| | `viewer` | `Player` | The player whose client will render the frozen body. | | `target` | `UUID` | The UUID of the player whose body should appear frozen. | | `enabled` | `boolean` | `true` to enable the freeze effect. | --- ### clearFreezePlayerBody ```java void clearFreezePlayerBody(Player viewer) ``` Clears all freeze player body effects for the viewer. | Parameter | Type | Description | |---|---|---| | `viewer` | `Player` | The player whose freeze effects should be cleared. | --- ### playBodyAnimation ```java void playBodyAnimation(Player viewer, UUID target, String animationName, boolean loop, float speed) ``` Plays a named body animation on a target player as seen by the viewer. The animation must be loaded via resource pack or previously sent inline via `loadInlineBodyAnimation`. | Parameter | Type | Description | |---|---|---| | `viewer` | `Player` | The player whose client will render the animation. | | `target` | `UUID` | The UUID of the player to animate. | | `animationName` | `String` | The animation identifier. | | `loop` | `boolean` | Whether the animation should loop. | | `speed` | `float` | Playback speed multiplier (1.0 = normal). | ```java void playBodyAnimation(Player viewer, UUID target, String animationName) ``` Convenience overload with default speed and no looping. --- ### stopBodyAnimation ```java void stopBodyAnimation(Player viewer, UUID target) ``` Stops the body animation on a target player. | Parameter | Type | Description | |---|---|---| | `viewer` | `Player` | The player whose client will stop rendering the animation. | | `target` | `UUID` | The UUID of the player whose animation should stop. | --- ### crossfadeBodyAnimation ```java void crossfadeBodyAnimation(Player viewer, UUID target, String animationName, float blendDuration, float speed) ``` Crossfades from the current body animation to a new one on a target player. | Parameter | Type | Description | |---|---|---| | `viewer` | `Player` | The player whose client will render the transition. | | `target` | `UUID` | The UUID of the player to animate. | | `animationName` | `String` | The animation to transition to. | | `blendDuration` | `float` | Blend duration in seconds. | | `speed` | `float` | Playback speed multiplier. | --- ### clearBodyAnimations ```java void clearBodyAnimations(Player viewer) ``` Clears all body animations for the viewer. | Parameter | Type | Description | |---|---|---| | `viewer` | `Player` | The player whose body animation effects should be cleared. | --- ### loadInlineBodyAnimation ```java void loadInlineBodyAnimation(Player viewer, String animationName, String animationJson) ``` Sends a Bedrock body animation JSON directly to the player's client, making it available for playback without requiring a resource pack. | Parameter | Type | Description | |---|---|---| | `viewer` | `Player` | The target player. | | `animationName` | `String` | The name to register the animation under. | | `animationJson` | `String` | The full Bedrock animation JSON string. | --- ### setBodyAnimationStates ```java void setBodyAnimationStates(Player viewer, UUID target, Map<String, String> stateAnimations, float crossfadeDuration) ``` Sets state-based body animations for a target player. The client automatically detects the target's movement state and plays the corresponding animation, crossfading between states. Valid state names: `IDLE`, `WALK`, `SPRINT`, `JUMP`, `FALL`, `SWIM`, `SNEAK`, `RIDE` | Parameter | Type | Description | |---|---|---| | `viewer` | `Player` | The player whose client will render the animations. | | `target` | `UUID` | The UUID of the player to animate. | | `stateAnimations` | `Map<String, String>` | Map of state name to animation name. | | `crossfadeDuration` | `float` | Blend duration in seconds when transitioning between states. | --- ### clearBodyAnimationStates ```java void clearBodyAnimationStates(Player viewer, UUID target) ``` Clears state-based body animations for a target player. | Parameter | Type | Description | |---|---|---| | `viewer` | `Player` | The player whose client will stop state animations. | | `target` | `UUID` | The UUID of the player whose state animations should stop. | --- ### playTotemScreen ```java void playTotemScreen(Player player, String itemId) ``` Plays the totem pop-up screen animation on the player's client. This is the vanilla totem of undying animation (item zooms into center of screen and fades out) without spawning any particles. | Parameter | Type | Description | |---|---|---| | `player` | `Player` | The target player. | | `itemId` | `String` | The item identifier (e.g. `"minecraft:totem_of_undying"`), or empty string for the default totem. | ```java void playTotemScreen(Player player) ``` Plays the default totem of undying screen animation. --- ## Related Pages - [[ILecternAPI]] — Access via `getScreenManager()` - [[ModalPromptButton]] — Button configuration for modal prompts - [[ModalPromptClickEvent]] — Fired when a CONSUMER button is clicked - [[Hand Animations]] — Full guide on the Bedrock hand animation system