HyperScript
Docs

← All of the Docs Working with values

Messages in several languages

structuremessages:since 1.7.15

At the left margin. Under it a language, written as the game writes it (en, de, pt_br), and under that name: "text" lines

messages:
    en:
        welcome: "&aWelcome, %player%!"
    de:
        welcome: "&aWillkommen, %player%!"

on player join:
    send message "welcome"
Try it
expressionmessage <name>since 1.7.15

The text of that name in the player's language. message <name> for <who> in someone else's

messages:
    en:
        greeting: "&7Hello!"
    es:
        greeting: "&7Hola!"

command /greet <player>:
    trigger:
        send message "greeting" for arg.1 to arg.1
Try it
Guide and examples

A script that speaks to players can keep its texts in one place, once for each language, and let every player read their own:

messages:
    en:
        welcome: "&aWelcome, %player%!"
        no-money: "&cYou cannot afford that."
    de:
        welcome: "&aWillkommen, %player%!"
        no-money: "&cDas kannst du dir nicht leisten."

on player join:
    send message "welcome"
WrittenMeaning
messages:At the left margin. Under it a language, written as the game writes it (en, de, pt_br), and under that name: "text" lines
message <name>The text of that name in the player's language. message <name> for <who> in someone else's
  • The language is the one the player has set in Minecraft. de_at uses de if there is no de_at; a language or a message that is missing falls back on the first language in the block, so write the complete one first.
  • A text may use colours, placeholders and saved variables (%player%, %{%player%.coins}%) but not local variables: put a value that changes into a saved variable, or add it after the message with +.
  • The messages belong to the file they are written in. The name must be written out in quotes (message "welcome"), and a name the block does not have is a mistake found when the file loads.
  • In a file without a messages: block, message keeps its other meaning: what was said in chat.