Skip to content

Dialog support - #2830

Open
davight wants to merge 15 commits into
DenizenScript:devfrom
davight:dialog-support
Open

Dialog support#2830
davight wants to merge 15 commits into
DenizenScript:devfrom
davight:dialog-support

Conversation

@davight

@davightdavight commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Related thread: https://discord.com/channels/315163488085475337/1392444399765684274

Additions

  • Support for creating minecraft dialogs by using the new DialogScriptContainer
  • New dialog command for opening dialogs

Changes

  • Needed to exclude adventure nbt api from pom

Visual examples with code

Notice dialogs:

notice_dialog:
 type: dialog
 title: <&c>You have been punished!
 dialog_type: notice
 body: Due to your taste in music you have been punished!
 button:
 label: Confirm
 tooltip: Click to confirm
 width: 100
image

Confirmation dialogs:

confirmation_dialog:
 type: dialog
 title: Teleport
 dialog_type: confirmation
 items:
 pearl:
 item: ender_pearl
 body: Do you want to be teleported to the spawn?
 yes_button:
 label: <&a>Yes
 tooltip: Click to confirm teleport!
 no_button:
 label: <&c>No
 tooltip: Click to cancel!
image

Multi-action dialogs:

multi_action_dialog:
 type: dialog
 title: Change things around
 dialog_type: multi_action
 body: Some fancy buttons
 buttons:
 spawn_firework:
 label: Spawn firework
 on click:
- narrate"Pretend that something spawned" save:
 label: Save
 on click:
- narrate"Saving data: <context.inputs>" inputs:
 teleport:
 type: boolean
 label: Allow players to send you <&b>teleport <&r>requests.
 friend_req:
 type: boolean
 label: Allow players to send you <&e>friend <&r>requests.
 initial: <player.has_flag[settings.friend_req]> max_per_loan:
 type: number
 label: Select minimum number for loan.
 min: 0
 max: <player.xp_level> welcome_message:
 type: text
 max_length: 10
 label: Enter <&d>welcome text <&r>for your warp<&co>
image

ScriptEvent.registerScriptEvent(WardenChangesAngerLevelScriptEvent.class);
}
ScriptEvent.registerScriptEvent(WorldGameRuleChangeScriptEvent.class);
if (NMSHandler.getVersion().isAtLeast(NMSVersion.v26_1)) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

v1_21

if (NMSHandler.getVersion().isAtLeast(NMSVersion.v26_1)) {
ScriptRegistry._registerType("dialog", DialogScriptContainer.class);
BukkitCommandRegistry.registerCommand(DialogCommand.class);
ScriptEvent.registerScriptEvent(PlayerClicksDialogButtonScriptEvent.class);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missed file? This event isn't part of your PR.

@davight

Copy link
Copy Markdown
ContributorAuthor

Fixed commented issues and also minor cleanup of examples in the PR description

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@davight@MC-Samuel