Docs
Chat Synchronization
Hytale DiscordSync provides bidirectional, low-latency communication between your in-game Hytale server and your community Discord channel.
How Chat Sync Works
1. In-Game to Discord
Whenever a player sends a message in Hytale:
- The plugin captures Hytale's native
PlayerChatEvent. - Extracts the sender's username via
PlayerRef.getUsername()and the message content. - Checks if the sender is listed in
ignoredAuthors(e.g. system broadcast filters). - Delivers the message to Discord formatted as:
markdown
**Username**: Message content here
2. Discord to In-Game
When a user types in your configured Discord channel:
- JDA captures the
MessageReceivedEvent. - Ignores bot messages to avoid infinite message loops.
- Formats the message according to
messages.discordToGameFormat(default:§9[Discord] §f%user%: %message%). - Broadcasts the message to all connected Hytale players using
player.sendMessage(Message.raw(...)).
Configuration Options
In config.json:
json
{
"messages": {
"discordToGameFormat": "§9[Discord] §f%user%: %message%",
"gameToDiscordFormat": "**%player%**: %message%"
},
"ignoredAuthors": ["System", "Sistema"]
}Placeholders
%user%: The Discord username of the sender.%player%: The in-game Hytale player name.%message%: The text message sent.