Full Segment

A full message, with all of the same message-based parts as a chat broadcast, as well as a list of conditions for it to appear.

{
  "type": "spawn_notification:full",
  "message": "spawn_notification.segments.biome",
  "segments": {
    "1": {
      "type": "spawn_notification:part",
      "part": "spawn_notification:biome"
    }
  }
}

Properties

type

The type for a full segment must always be spawn_notification:full so the mod knows this is a full segment.

message

The 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.

segments

The 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.

Built-In Segment Types

conditions

A list of conditions that are part of this situation. If all conditions in this list match the current event context, and the triggers match the current event context, it and its otherSituations will be added to the list of situations that have gone off in the current event context.

Built-In Condition Types

fallback

The message to fall back to if the conditions for this segment aren’t met. If this isn’t provided and the conditions aren’t met, it will be removed from the segment list.