Skip to content

Add PlayerDialogClickEvent - #277

Closed
kazotaruumc72 wants to merge 1 commit into
Maxlego08:developfrom
MineArena:feature/dialog-click-event
Closed

kazotaruumc72 wants to merge 1 commit into
Maxlego08:developfrom
MineArena:feature/dialog-click-event

Conversation

@kazotaruumc72

@kazotaruumc72 kazotaruumc72 commented Nov 7, 2026 •

Copy link
Copy Markdown

Summary

Adds PlayerDialogClickEvent (fr.maxlego08.menu.api.event.events), called when a player clicks a custom-click button of a dialog, before the actions of the button run.

  • getPlayer()
  • getDialogName(): file name of the dialog without .yml (same value as DialogInventory#getFileName)
  • getButtonName(): last segment of the button's configuration path: button1 for multi-actions.button1, yes / no for a confirmation dialog, notice, exit-button, ...
  • Cancellable: cancelling it prevents the actions of the button from running.

Use case: plugins reacting to dialog buttons without adding actions to every dialog file, e.g. a DIALOG_CLICK quest type in zQuests (Maxlego08/zQuests PR to follow).

Implementation

  • ZCustomClickDialogActionLoader passes the dialog name (from the file) and the button key (from the path) to ZCustomClickDialogAction.
  • ZCustomClickDialogAction calls the event at the start of its click callback. The previous constructor is kept and does not call the event.
  • Changelog entry added under New Features.

Note: canvas click values also go through ZCustomClickDialogActionLoader; for them the button name is the last segment of the click path.

Test plan

  • ./gradlew :API:compileJava :Hooks:Paper:compileJava passes
  • In-game check on a multi_action and a confirmation dialog

🤖 Generated with Claude Code

Called when a player clicks a custom-click button of a dialog, before its
actions run. Gives the dialog file name and the button key. Cancelling it
prevents the actions from running.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@alwyn974 alwyn974 closed this Nov 7, 2026
Repository owner locked and limited conversation to collaborators Nov 7, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants