adventure icon indicating copy to clipboard operation
adventure copied to clipboard

Click event source

Open kezz opened this issue 4 years ago • 2 comments

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!

kezz avatar Jun 23 '21 06:06 kezz

Maybe just a "copy" of HoverEventSource?

kashike avatar Jun 23 '21 07:06 kashike

Maybe just a "copy" of HoverEventSource?

Yes, implementation could provide a "default" click event and people could use the unary operator method to change the action if they wanted.

kezz avatar Jun 23 '21 08:06 kezz