{
"destination": "spawn_notification:chat",
"message": "spawn_notification.notification.captured",
"segments": {
"1": "spawn_notification:packed/pre",
"2": "spawn_notification:packed/pokemon",
"3": "spawn_notification:packed/post"
}
}
destinationThe destination for a chat broadcast will always be spawn_notification:chat to allow the mod to determine that it is a chat broadcast.
messageThe template message for a chat broadcast. If you’re familiar with Minecraft lang files, it’s the string that has the %1$s etc inside of it to allow for substituting in context-specific segments. It can either be a lang file key, which means you need a matching entry in a lang file and players will be able to change their client language in their game and receive translated messages, or it can be a direct template string, which means players won’t need the mod or addon on their client, but their client also won’t be able to translate it.
For example, you can use the above example’s spawn_notification.notification.captured and players will be able to translate it on their client, or you can use the template string for that key, which is The %1$s%2$s was captured%3$s! and players will only ever see the English version. I’d recommend using the lang key version for Minecraft’s built-in translation logic, except for things that don’t need to be translated (think waypoints, they have a specific format that doesn’t get translated).
If a message property is not provided for this broadcast, a default message containing a placeholder (%1$s, etc) for each item in segment will be created.
segmentsThe segments to be substituted into the broadcast’s message’s placeholders (the %1$s, etc). In the above example, the captured message template will have the result of evaluating out spawn_notification:packed/pre at %1$s, spawn_notification:packed/pokemon at %2$s, and spawn_notification:packed/post at %3$s. The example segments are reference segments, just resource locations/IDs that point to other pre-made segments in the notification/segment data folder. Here’s the Built-In Segment Types list for other types. By default, it’s an empty list.
Any segments that evaluate out to nothing, without a fallback, will be remove from the segment list. Make sure you provide a fallback for segments that should always exist.
broadcastRangeThe range in blocks at which to broadcast this chat message. By default, it uses the config’s property by the same name, which sets it to -1 and disables this feature.
playerLimitThe maximum number of players (sorted by closest first) to broadcast this chat message to. By default, it uses the config’s property by the same name, which sets it to -1 and disables this feature.
broadcastAcrossDimensionsIf this broadcast should be sent to all players on the server, regardless of if they’re in the same dimension as the current event. By default, it uses the config’s property by the same name, which sets it to false and only sends to players in the same dimension as the current event. If set to true, broadcastRange and playerLimit are ignored.