Modify Elements

AsaJS allows you to modify or override existing UI elements in Minecraft: Bedrock Edition — whether it's the vanilla UI or custom UIs like NekoUI, Ty-el UI, or BetMC UI

How to Modify Elements

To modify Elements, you need to import the following modules:

  • Vanilla: for built-in Minecraft UI Elements (e.g. start screen)
  • Modify: for external/custom packs (e.g. NekoUI, Ty-el UI, BetMC UI)

You can find modifiable UI paths for vanilla Minecraft from the Bedrock Samples repository.

Examples

Add a Text to the Vanilla Start Screen

import { Vanilla, UI } from "asajs" // Create a new text label const text = UI.label({ text: "Hello, world!", layer: 10, shadow: true, }) // Add it to the start screen Vanilla.start.startScreenContent().addChild(text)

Custom Background for NekoUI

import { Modify, UI } from "asajs" // Modify a specific UI file in NekoUI const nekoUI_BG = Modify.register(".hans_common_files/.hans_animated_background.json", "bg_anim") // Remove the default background nekoUI_BG.modify.controls.remove("bg_anim_b") // Create a new custom background const customBG = UI.panel({ size: "100%" }).addChild( UI.image({ size: "100%", fill: true, texture: "path/to/your/image.png", }) ) // Add the custom background nekoUI_BG.addChild(customBG)

This only works if the user has NekoUI installed.

Override UI Elements

You can also override an entire screen or container using override.

Example: Override Vanilla Start Screen

import { Vanilla, UI } from "asajs" const text = UI.label({ text: "Hello, world!", layer: 10, shadow: true, }) // Completely override the start screen Vanilla.start.startScreenContent().override.addChild(text)

Tips

  • Always check the UI hierarchy in the target UI pack to know what you’re modifying.
  • Use .override carefully — it replaces the original content.
  • If you’re modifying external packs, be sure the pack is actually installed and active in Minecraft.

Next: Modify Elements

UI Methods: Learn some basic methods of UI elements.

Contributors

AsakiYuki