Skip to content

Dialog API#12634

Closed
akarahdev wants to merge 14 commits into
PaperMC:dev/1.21.6from
akarahdev:dev/1.21.6
Closed

Dialog API#12634
akarahdev wants to merge 14 commits into
PaperMC:dev/1.21.6from
akarahdev:dev/1.21.6

Conversation

@akarahdev
Copy link
Copy Markdown

@akarahdev akarahdev commented Jun 6, 2025

o/

Purpose

I'm creating this (draft) PR to attempt to create a Dialog API for PaperMC.

Currently, the scope of this PR is to create an API that allows you to:

  • Build dialogs (in a syntax similar to how Item Components are built)
  • Send built dialogs to players

I decided to give trying it a start since I have a lot of time on my hands (summer vacation!). I am aware that 1.21.6 is in pre-release, so the Dialog API is due for frequent change. Don't worry, I should be able to keep up with this. I'll turn this into an official PR when I finish covering the Dialog's API, and 1.21.6 comes into official release.

Progress Checklist

  • Dialog Types
  • Body Elements
  • Input Elements
  • Action Types
  • Dialog Registry Manipulation
  • Javadocs & Other Documentation
  • DialogConversion type should return a Holder<Dialog>
  • Figure out migration to MinecraftServer#handleCustomClickAction

Unresolved Problems

These are questions I'm currently dealing with when working on this PR. If you're seeing this, feel free to chime in your opinion on any of these. I can solve these myself given some time, but extra feedback on any of these would be appreciated.

  • Are the classes named & organized appropiately?
  • PaperMC doesn't use inner classes a lot, but I use them here. I'm open to changing this if anyone wants me to, it's a quick refactor.

Note

Since this is my first Paper PR, I'm probably going to make mistakes along the way. If there's anything you don't like about my PR you want me to fix, feel free to comment and I'll get it done. :)

@github-project-automation github-project-automation Bot moved this to Awaiting review in Paper PR Queue Jun 6, 2025
@akarahdev akarahdev changed the title add basic dialog types & add bridge for dialogs Dialog API Jun 6, 2025
@yannicklamprecht
Copy link
Copy Markdown
Contributor

I suggest adding that as an adventure like module, so that it can be used in Velocity as well, as Dialogs are basically protocol only stuff.

@akarahdev
Copy link
Copy Markdown
Author

akarahdev commented Jun 6, 2025

I suggest adding that as an adventure like module, so that it can be used in Velocity as well, as Dialogs are basically protocol only stuff.

I think that's a good idea aswell, however previous maintainers of PaperMC have expressed wishes to develop it in Paper first.
image

While not official, I do believe it's a good idea to start on Paper.
image
This is the version history for Dialogs so far, and it is pretty substantial how unstable it is.

Additionally, we can always migrate these APIs to Adventure later, and I'm trying to keep the style similar so migration is easy and fits in with the pre-existing Adventure APIs.

Also, your comment made me realize Kezz is working on a Dialog API for Adventure.
PaperMC/adventure#1238
I might try to work with them on this aswell if I can, so we can agree on an API. I'm not the most adept at knowing how Adventure APIs are created, so working with someone who has a good understanding would help.

+ return event;
+ }
+ // Paper end - Add fail move event
+
Copy link
Copy Markdown
Contributor

@yannicklamprecht yannicklamprecht Jun 6, 2025

Choose a reason for hiding this comment

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

Instead implement MinecraftServer#handleCustomClickAction(ResourceLocation id, Optional<Tag> payload)

Copy link
Copy Markdown
Author

@akarahdev akarahdev Jun 6, 2025

Choose a reason for hiding this comment

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

I tried, and it did work, however I could not get the player that clicked in the event. Do you know of a way to do that?

@akarahdev
Copy link
Copy Markdown
Author

akarahdev commented Jun 7, 2025

I finished all of the main formats for the Dialog, so I changed the checklist. Now an overview of all of the Dialog formats are checked off, and the remainder tasks are ones I planned to do before.

Edit: As a side note, I apologize if this PR goes slower over this upcoming weekend, I have a lot of things to do because of graduation.

@Owen1212055
Copy link
Copy Markdown
Member

Owen1212055 commented Jun 7, 2025

Hey, thank you for the time and effort you put into this PR. After an internal conversation we’ve decided we will be closing this.

The dialogue system that we are going to be introducing has to be strictly tied to our registry API lifecycle so that dialogues can be fully utilized on Paper. This includes bootstrap registration to support quick-action support amongst other things. This in itself has a number changes that will be required, as our API does not nicely support mutating ItemStacks during bootstrapping, so some decisions are still being figured out as to the best path to go for that is. Because of all of this, continuing with this exact implementation would likely duplicate effort and fall out of sync quickly, as additionally we are having to plan a bit with adventure in order to make sure that the new click types are properly implemented.

Your contribution is still much appreciated, and we’d love to see you still involved in Paper. If you’d like to help there, please keep in touch in dev channels on discord as update processes are more involved with the Paper Team. And going forward, especially for larger projects like these we would love to hear about first.

@Owen1212055 Owen1212055 closed this Jun 7, 2025
@github-project-automation github-project-automation Bot moved this from Awaiting review to Closed in Paper PR Queue Jun 7, 2025
@akarahdev
Copy link
Copy Markdown
Author

Hey, thank you for the time and effort you put into this PR. After an internal conversation we’ve decided we will be closing this.

The dialogue system that we are going to be introducing has to be strictly tied to our registry API lifecycle so that dialogues can be fully utilized on Paper. This includes bootstrap registration to support quick-action support amongst other things. This in itself has a number changes that will be required, as our API does not nicely support mutating ItemStacks during bootstrapping, so some decisions are still being figured out as to the best path to go for that is. Because of all of this, continuing with this exact implementation would likely duplicate effort and fall out of sync quickly, as additionally we are having to plan a bit with adventure in order to make sure that the new click types are properly implemented.

No worries, I was somewhat expecting this anyways. I figured I'd try anyways, it was worth a shot. Had fun making it!

Your contribution is still much appreciated, and we’d love to see you still involved in Paper. If you’d like to help there, please keep in touch in dev channels on discord as update processes are more involved with the Paper Team. And going forward, especially for larger projects like these we would love to hear about first.

I am interested indeed, I was just wondering what channels? I don't have the Contributor role, so I can't see any special channels, if there are any you were mentioning. I see #paper-contrib, but I can't speak in it.

@Owen1212055
Copy link
Copy Markdown
Member

Mostly in #paper-dev, if you are wanting to talk about stuff there are plenty of people who are interested in contributing to Paper who also talk in there. Feel free to ping me if you are thinking about adding anything in particular and we can chat about it! :)

@akarahdev
Copy link
Copy Markdown
Author

Mostly in #paper-dev, if you are wanting to talk about stuff there are plenty of people who are interested in contributing to Paper who also talk in there. Feel free to ping me if you are thinking about adding anything in particular and we can chat about it! :)

Thank you! :) I'm gonna be busy over these next few days, so I might not be able to do much for a little while, but after I'll see what I can do!

@Owen1212055
Copy link
Copy Markdown
Member

All good, thanks again for your understanding!

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

Labels

None yet

Projects

Status: Closed

Development

Successfully merging this pull request may close these issues.

3 participants