#Title UI help
1 messages · Page 1 of 1 (latest)
use "body"
Use "body"
But seriously, you need to bind the #form_text property to a #text property of a label and in script you need to call the .body( yourString) function
import { ActionFormData } from "@minecraft/server-ui"
const ui = new ActionFormData()
.title("Form")
.body("") //like this?
.button("button1")
.button("button2")
.button("button3");
const customUi = new ActionFormData()
.title("Custom Form")
.body("")
.button("Rewards", "textures/ui/promo_holiday_gift_small")
.button("Shop", "textures/ui/icon_deals")
.button("Ban Tool", "textures/ui/hammer_l")
.button("Skins", "textures/ui/icon_hangar")
.button("Skins", "textures/ui/icon_hangar")
.button("Skins", "textures/ui/icon_hangar")
.button("Skins", "textures/ui/icon_hangar")
.button("Skins", "textures/ui/icon_hangar")
.button("Skins", "textures/ui/icon_hangar");
world.afterEvents.itemUse.subscribe(async (event) => {
const { source, itemStack } = event
switch (itemStack.typeId) {
case "minecraft:compass": ui.show(source); break;
case "minecraft:clock": {
const res = await customUi.show(source);
res.selection //This Is Number Will Be Derived From The "collection_index" property of a button in JSON UI
world.sendMessage(`Button ${res.selection} Has Been Pressed!`)
break
};
}
})```
@toxic cargo yes