Skip to content

Navigation Menu

Sign in
Sign up

Dialog support - #2830

Open
davight wants to merge 17 commits into
DenizenScript:dev from
davight:dialog-support
Open

Dialog support #2830
davight wants to merge 17 commits into
DenizenScript:dev from
davight:dialog-support

Conversation

@davight

@davight davight commented Jun 29, 2026
edited
Loading

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)) {

@MC-Samuel MC-Samuel Jun 29, 2026

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);

@MC-Samuel MC-Samuel Jun 29, 2026

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 commented Jun 30, 2026

Copy link
Copy Markdown
Contributor Author

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

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

Reviewers

1 more reviewer
@MC-Samuel MC-Samuel MC-Samuel left review comments
Reviewers whose approvals may not affect merge requirements

At least 2 approving reviews are required to merge this pull request.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /