How to make Clickable Text

Can anyone explain how to make clickable text in a player message?

According to the currently outdated (but still useful) Messages docs, and my own limited experimentation, it would seem that you include it as you are building a Text.

Example:
Text txt = Texts.builder(“Hello!”).onClick(TextActions.runCommand(“ban allthegriefers 5ever”)).build();

5 Likes

You sir or ma’am, are a genius!

3 Likes

Well, do you know how to put a hover text block underneath it. Like when you hover over items in your inventory.

https://jd.spongepowered.org/org/spongepowered/api/text/action/TextActions.html#showText-org.spongepowered.api.text.Text-