Basalt's own: the 1.26 client's data-driven minecraft:custom_form screen, as PowerNukkitX builds it.
Class in @minecraft/server-ui
Basalt’s own: the 1.26 client’s data-driven minecraft:custom_form screen, as PowerNukkitX
builds it. Buttons run their callback each time they’re pressed, while the screen stays open.
import { CustomForm } from '@minecraft/server-ui';Constructor
Section titled “Constructor”constructor(title?: Text);Parameters
titleoptionalText
Methods
Section titled “Methods”closeButton
Section titled “closeButton”closeButton(label?: Text): CustomForm;The X in the corner.
Parameters
labeloptionalText
Returns
CustomFormbutton
Section titled “button”button(label: Text, onClick: () => void, options?: CustomFormButtonOptions): CustomForm;Parameters
labelTextonClick() => voidoptionsoptionalCustomFormButtonOptions
Returns
CustomFormtextField
Section titled “textField”textField(label: Text, defaultValue?: string, options?: CustomFormFieldOptions): CustomForm;Parameters
labelTextdefaultValueoptionalstringoptionsoptionalCustomFormFieldOptions
Returns
CustomFormtoggle
Section titled “toggle”toggle(label: Text, defaultValue?: boolean, options?: CustomFormFieldOptions): CustomForm;Parameters
labelTextdefaultValueoptionalbooleanoptionsoptionalCustomFormFieldOptions
Returns
CustomFormslider
Section titled “slider”slider(label: Text, min: number, max: number, defaultValue?: number, options?: CustomFormSliderOptions): CustomForm;Whole numbers only.
Parameters
labelTextminnumbermaxnumberdefaultValueoptionalnumberoptionsoptionalCustomFormSliderOptions
Returns
CustomFormdropdown
Section titled “dropdown”dropdown(label: Text, items: Text[], defaultIndex?: number, options?: CustomFormFieldOptions): CustomForm;Parameters
labelTextitemsText[]defaultIndexoptionalnumberoptionsoptionalCustomFormFieldOptions
Returns
CustomFormlabel(text: Text): CustomForm;Parameters
textText
Returns
CustomFormheader
Section titled “header”header(text: Text): CustomForm;Parameters
textText
Returns
CustomFormspacer
Section titled “spacer”spacer(): CustomForm;Returns
CustomFormshow(player: Player): Promise<ScreenResponse>;Resolves when the screen closes.
Parameters
playerPlayer
Returns
Promise<ScreenResponse>Types