-
Notifications
You must be signed in to change notification settings - Fork 0
π¬ Chat Module
Gustavo M. Paes edited this page Sep 23, 2021
·
1 revision
Need declare Intent.CHAT to Work
ChatMessage(String msg, Sound? sound, ClickEvent? clickEvent, HoverEvent? hoverEvent) -> ChatMessage
-
msgis the message -
soundis the sound that will play when receiving the message. Optional -
clickEventevent when clicking in the message on chat. Optional -
hoverEventevent when hovering the cursor in the message on chat. Optional
Class with information of message templates that you can create a pattern
-
keyis the message pattern key -
chatMessageis the class with message templates
Register a message template in your plugin
-
plis the player will receive the message -
messageKeyis the message template key (you declare in registerChatMessage) -
messageis the message will gonna bemessage template text+message -
supressSoundwill suppress the sound from the template. Optional
Send a player message with a pattern
Mars.chat.send(Player pl, String messageKey, Hashmap<String, String> replacer, boolean? supressSound) -> void
-
plis the player will receive the message -
messageKeyis the message template key (you declare in registerChatMessage) -
replaceris a hashmap with 2 Strings, the first one is a replacer like '[player'] and the second one is the value is gonna be replaced like 'GumpDev' -
supressSoundwill suppress the sound from the template. Optional
Send a player message with a pattern
Gets the volume of the sound will play when the player receives the message
-
volumeis the new volume
Sets the volume of the sound will play when the player receives the message
Gets the pitch of the sound will play when the player receives the message
-
pitchis the new pitch
Sets the pitch of the sound will play when the player receives the message
-
plis the player will be listen -
eventis an action with PlayerChatEvent
Will listen to the next message of a player in the chat
-
plis the player will be unlisten
Will remove onSay event from a player
Mars it's created by GumpDev and use some repositories like PaperMC and SkullCreator