All Superinterfaces:
SectionRecord
All Known Implementing Classes:
FinalMessageRecord, InvalidMessageRecord, ValidMessageRecord

public sealed interface MessageRecord extends SectionRecord permits ValidMessageRecord, InvalidMessageRecord, FinalMessageRecord
A sealed interface representing a structured message record loaded from the MESSAGES section of a language YAML file.

A MessageRecord contains all the information required to display text or titles to players using templated and macro-resolved content. This includes:

  • A main message body (chat message)
  • An optional title/subtitle display
  • Timing controls (title fade-in, stay, and fade-out durations)
  • Optional repeat delay for messages that would otherwise repeat too frequently

Implementations

Factory Methods

Use of(ValidMessageKey, ConfigurationSection) to parse a configuration section, or empty(RecordKey, InvalidRecordReason) to create an invalid placeholder when parsing fails.
See Also:
  • Method Details

    • of

      static MessageRecord of(ValidMessageKey messageKey, org.bukkit.configuration.ConfigurationSection messageEntry)
      Factory method that constructs a MessageRecord from a YAML configuration section. Returns a ValidMessageRecord if the section is non-null and valid, or an InvalidMessageRecord if the section is missing.
      Parameters:
      messageKey - the unique record string used to identify this message
      messageEntry - the corresponding YAML configuration section
      Returns:
      a valid or invalid MessageRecord depending on input
    • empty

      static InvalidMessageRecord empty(RecordKey messageKey, InvalidRecordReason reason)
      Returns an InvalidMessageRecord representing a missing or invalid message definition.
      Parameters:
      messageKey - the string associated with the missing record
      Returns:
      a placeholder MessageRecord indicating an empty or unresolved message