🔨Message Builder
Create messages with hover events and other cool stuff
Overview
The MessageBuilder
class provides utility methods to build clickable and hoverable text components using the BungeeCord API.
Methods
buildHoverText
buildHoverText
Builds a hoverable text component with the specified base component and hover text.
Parameters
baseComponent
: The base TextComponent to which the hover event will be added.hoverText
: The text to be displayed when hovering over the base component.
Returns
TextComponent
: The modified TextComponent with the added hover event.
buildCommandText
buildCommandText
Builds a clickable text component with the specified text and command to be executed when clicked.
Parameters
text
: The text to be displayed.clickCommand
: The command to be executed when the text is clicked.
Returns
TextComponent
: The clickable TextComponent.
buildEntityText
buildEntityText
Builds a hoverable text component displaying information about an entity type when hovered over.
Parameters
text
: The text to be displayed.entityType
: The EntityType to be displayed information about.
Returns
TextComponent
: The hoverable TextComponent displaying entity information.
buildOpenUrlText
buildOpenUrlText
Builds a clickable text component that opens a URL when clicked.
Parameters
text
: The text to be displayed.url
: The URL to be opened when the text is clicked.
Returns
TextComponent
: The clickable TextComponent.
Usage
Use the static methods of the
MessageBuilder
class to create clickable and hoverable text components.Provide the necessary parameters to each method to customize the text behavior.
Use the returned
TextComponent
objects wherever you need to display formatted and interactive text in your plugin.
Example
Last updated