Chat Module
Overview
The chat module allows you to interact with and modify users chat feeds.
- Adds the ability to simulate live updating messages
- Grants the ability to remove specific messages for a player
Example of simulating live chat!
Integration
Sample Code
Explore each integration by cycling through each tab, to find the best fit for your requirements and needs.
Displaying a Live Chat Message
private int countdown = 5;
public void displayLiveChatMessageExample() {
this.chatModule.displayLiveChatMessage(Recipients.ofEveryone(),
Component.text("Game starting in ", NamedTextColor.GREEN)
.append(Component.text(this.countdown, NamedTextColor.BLUE)),
13
);
if (--this.countdown == 0) {
this.countdown = 5;
}
}
Removing a Live Chat Message
public void removeLiveChatMessageExample() {
this.chatModule.removeLiveChatMessage(Recipients.ofEveryone(), 13);
}