-
Notifications
You must be signed in to change notification settings - Fork 0
Bukkit
BukkitChatAPI.newBuilder() creates a new basic ChatBuilder.
.build() - returns a ChatMessage with all the components added to the ChatBuilder.
.newLine() - adds a new line.
.appendText( String text ) - adds the text to the Builder and creates converts automatically all ChatColor elements.
.append( String text ) - works like .appendText( String text ) but additionally converts all URLs to clickable URLs.
.openColor( ChatColor color ) - opens a format section with the color.
.closeColor() - closes the last opened format section.
.closeColor( ChatColor color ) - closes the opened format section with the given color.
Just create a Click Event Object:
IEventClick event = new ClickEvent(ActionClick action, String value);
And then just open the Event Section:
Open Click Event: .openClick( IEventClick event )
Close Click Event: .closeClick( IEventClick event )
Close last Click: .closeClick()
Again create an Hover Event Object:
IEventHover event = new HoverEvent(ActionHover action, IComponentChat value);
For simple values (like Strings) use:
IEventHover event = HoverEvent.showText( String value );IEventHover event = HoverEvent.showText( IComponentChat value );IEventHover event = HoverEvent.achievement( String value );IEventHover event = HoverEvent.item( String value );
And then open the Event Section:
Open Hover Event: .openHover( IEventHover event )
Close Hover Event: .closeHover( IEventHover event )
Close last Hover: .closeHover()
BukkitChatAPI.newBBCodeBuilder() creates a ChatBuilder that can parse BBCode.
.appendBBCode( String message ) parses the message as BBCode and appends it to the builder.
You can see all possible formats > here <