configuration/Format-Strings

Format-Strings

Most strings in "components.yml" can contain formatting values. Each formatting value is enclosed between ${ and } and the values are stored in this syntax (()? denotes optional values.): <key>(,<format-types>(,<format-arguments>)?)?

There are the following format types:

  • player
    Formats the given playername inside the key.
    Each character character in the following table will be replaced with the following table:
    • w - The world the player is in.
    • n - The raw name of the player.
    • d - The display name of the player.
    • l - The name of the player shown in the player-list.
    • c - The custom-name of the player. (You never need this.)
    • a - The IP-Address of the player.
    • A - The Host-Name of the player.
    • p - Player-specific prefix (Requires Vault)
    • P - Group-specific prefix (Requires Vault)
    • s - Player-specific suffix (Requires Vault)
    • S - Group-specific suffix (Requires Vault)
    • g - Group of the player (Requires Vault)
  • number, date, time, choice
    Read the JavaDoc of this class: MessageFormatPoints to oracle.com
    Note that these for format-types depend on the locale of your system.

Predefined values on chat messages

source
A string denoting the source component which is processing the message.
sender
A string denoting the sender of the message.
receiver
A string denoting the receiver of the message. (May be nothing if it was sent to everyone.)
message
The message the player sent.

Examples

&7[&e${sender,player,pds}&7] ${message} could be formatted to [<Dev>StuxCrystal] This is a test message.


Comments

Posts Quoted:
Reply
Clear All Quotes