💬 Chat Module - gumpdev/mars GitHub Wiki
Classes:
Methods:
Events:
Need declare Intent.CHAT to Work
ChatMessage(String msg, Sound? sound, ClickEvent? clickEvent, HoverEvent? hoverEvent) -> ChatMessage
msgis the messagesoundis the sound that will play when receiving the message. OptionalclickEventevent when clicking in the message on chat. OptionalhoverEventevent when hovering the cursor in the message on chat. Optional
Class with information of message templates that you can create a pattern
Mars.chat.registerChatMessage(String key, [ChatMessage](#ChatMessage) chatMessage) -> void
keyis the message pattern keychatMessageis the class with message templates
Register a message template in your plugin
Mars.chat.send(Player pl, String messageKey, String message, boolean? supressSound) -> void
plis the player will receive the messagemessageKeyis the message template key (you declare in registerChatMessage)messageis the message will gonna bemessage template text+messagesupressSoundwill 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 messagemessageKeyis 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
Mars.chat.getVolume() -> float
Gets the volume of the sound will play when the player receives the message
Mars.chat.setVolume(float volume) -> void
volumeis the new volume
Sets the volume of the sound will play when the player receives the message
Mars.chat.getPitch() -> float
Gets the pitch of the sound will play when the player receives the message
Mars.chat.setPitch(float pitch) -> void
pitchis the new pitch
Sets the pitch of the sound will play when the player receives the message
Mars.chat.onSay(Player pl, ChatEvent event) -> void
plis the player will be listeneventis an action with PlayerChatEvent
Will listen to the next message of a player in the chat
Mars.chat.removeEvent(Player pl) -> void
plis the player will be unlisten
Will remove onSay event from a player