New Dialog Button (Expression) — Skript

Addon: Skript · Category: Expression

Syntax

[new] dialog button labeled %component% [with tooltip %component%] [with width %number%] [(command:running command %string%|url:opening url %string%|suggest:suggesting %string%|copy:copying %string%|show:showing dialog %dialog%|page:changing page %number%|custom:with custom action %string% [with payload %nbtcompound%]|dynamic:with dynamic custom action %string% [with additions %nbtcompound%])]

Description

Creates a button for a dialog with a fixed action. A button with no action just closes the dialog according to its after action setting. Add 'running code' with a section instead when the button should run script code. A custom action key must be in 'namespace:value' format and is what 'on dialog click' matches on. A dynamic custom action key is the same, but the client sends the dialog's input values back with the click, so 'dialog input' works in an 'on dialog click' handler for it; 'with additions' merges extra fixed NBT into that payload.

Examples

set {_buy} to new dialog button labeled "<green>Buy" with tooltip "Costs 10 coins" running command "buy"
set {_wiki} to new dialog button labeled "Wiki" opening url "https://example.com"
set {_next} to new dialog button labeled "More" showing dialog {_other}
set {_confirm} to new dialog button labeled "Confirm" with dynamic custom action "myserver:confirm"

View source