跳到主要内容

Paper Dialog

Display a customizable dialog

字段

字段类型默认值描述
messageVar<String>—Lines of text displayed in the dialog body.占位符多行
bodyItemVar<Item>—Item showcased in the dialog body (empty for none).
buttonsList<DialogButtonConfig>empty—变体:action_buttonboolean_buttonmultiple_choice_buttonnumber_range_buttontext_input_buttontrigger_button
action_button(3)
字段类型默认值描述
labelVar<String>—Text displayed on the button.占位符
commandVar<String>—Command executed when the button is clicked.占位符
asOpVar<Boolean>falseWhether to execute the command as OP.
boolean_button(8)
字段类型默认值描述
labelVar<String>—Label displayed next to the toggle.占位符
keyVar<String>DialogKey.BOOLEAN.keyKey used to insert the value in the command. Default: 'boolean'.占位符
initialVar<Boolean>false—
onTrueVar<String>—Value inserted in the command when the toggle is true.占位符
onFalseVar<String>—Value inserted in the command when the toggle is false.占位符
commandVar<String>—Command template executed when the confirmation button is clicked. Use $(<key>) to insert the value.占位符
asOpVar<Boolean>falseWhether to execute the command as OP.
buttonLabelVar<String>OKLabel for the confirmation button.占位符
multiple_choice_button(6)
字段类型默认值描述
labelVar<String>—Label displayed above the options.占位符
keyVar<String>DialogKey.CHOICE.keyKey used to insert the selected option in the command. Default: 'choice'.占位符
optionsVar<String>—Comma separated options. Append * to mark the initial option.占位符
commandVar<String>—Command template executed when the confirmation button is clicked. Use $(<key>) to insert the selected option.占位符
asOpVar<Boolean>falseWhether to execute the command as OP.
buttonLabelVar<String>OKLabel for the confirmation button.占位符
number_range_button(9)
字段类型默认值描述
labelVar<String>—Label displayed above the slider.占位符
keyVar<String>DialogKey.VALUE.keyKey used to insert the value in the command. Default: 'value'.占位符
startVar<Int>0—
endVar<Int>0—
initialVar<Int>MIN_VALUE—
stepVar<Int>1—
commandVar<String>—Command template executed when the confirmation button is clicked. Use $(<key>) to insert the value.占位符
asOpVar<Boolean>falseWhether to execute the command as OP.
buttonLabelVar<String>OKLabel for the confirmation button.占位符
text_input_button(11)
字段类型默认值描述
labelVar<String>—Label displayed above the text input.占位符
keyVar<String>DialogKey.INPUT.keyKey used to insert the value in the command. Default: 'input'.占位符
commandVar<String>—Command template executed when the confirmation button is clicked. Use $(<key>) to insert the value.占位符
asOpVar<Boolean>falseWhether to execute the command as OP.
buttonLabelVar<String>OKLabel for the confirmation button.占位符
widthVar<Int>200—
labelVisibleVar<Boolean>true—
initialVar<String>——
maxLengthVar<Int>256—
maxLinesVar<Int>0—
heightVar<Int>0—
trigger_button(2)
字段类型默认值描述
labelVar<String>—Text displayed on the button.占位符
triggersList<Ref<TriggerableEntry>>emptyEntries triggered when the button is clicked.
exitButtonExitButtonConfig——
ExitButtonConfig(3)
字段类型默认值描述
labelVar<String>—Text displayed on the exit button.占位符
commandVar<String>—Command executed when the exit button is clicked.占位符
asOpVar<Boolean>falseWhether to execute the command as OP.
showExitButtonVar<Boolean>trueWhether to display the exit button.占位符
columnsVar<Int>1Number of columns to display.占位符
dialogTypeDialogDisplayTypeMULTI_ACTIONWindow layout: button grid, yes/no confirmation, or single-button notice.
afterActionDialogCloseBehaviourCLOSEWhat happens client-side after clicking a button.可选值:CLOSENONEWAIT_FOR_RESPONSE
TypeWriter 通用字段(criteria, modifiers, triggers, displayName)
字段类型默认值描述
criteriaList<Criteria>empty—
modifiersList<Modifier>empty—
triggersList<Ref<TriggerableEntry>>empty—
displayNameVar<String>—Custom display name for the dialog title.占位符

How to use it​

Build the whole window in this one entry.

  1. Set displayName (title), message (body text, several lines allowed) and optionally bodyItem.
  2. Pick dialogType: MULTI_ACTION (grid with columns), CONFIRMATION (first button = yes, exit button = no) or NOTICE (one button).
  3. Add buttons in buttons. Choose a type for each: action, trigger, text input, boolean, multiple choice or number range.
  4. Configure exitButton. It is shown when showExitButton is on, and always in CONFIRMATION mode. With an empty command, it just closes the dialog.
  5. Choose afterAction: CLOSE, NONE (stay open) or WAIT_FOR_RESPONSE.

Commands run as the clicking player (as OP for the duration of the command when asOp is on). In a command, $(key) is replaced by the value of the input with that key. A trigger button fires its triggers for the player, so you can continue a quest sequence from a click without any command.

See the main page for the full table of button types and layouts.