PaperMC / PaperMC/adventure

Click event source

Open
#409 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area: api type: enhancement
Dominant language
Java
Stars
887
Forks
160
PR merge metrics
No merged PRs in 30d

Description

Similar to HoverEventSource, it would be nice to be able to use arbitrary objects as click events. Some thought would need to go into the implementation of this, as some objects (e.g. commands) would have two obviously different applicable click events.

Perhaps something along the lines of object.asClickEvent(ClickEvent.Action.RUN_COMMAND). This would, however, raise the issue that you could create invalid click events. Alternative solutions could be providing interfaces for each type of click event, e.g. object.asRunCommandClickEvent().

Would appreciate any thoughts/ideas!

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the existing HoverEventSource API and ClickEvent.Action, then compare the proposed object.asClickEvent and type-specific interface approaches. The design should support arbitrary objects as click-event sources while preventing invalid click events, with a documented API decision serving as the completion criterion.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.