xyz.refineryteam.refinerycore.api.i18n.Messages is a per-player-locale message registry backed by YAML files in <datafolder>/lang/<locale>.yml. Each player sees messages in their client language automatically, falling back to a default locale and then to the raw key — so a missing translation degrades gracefully instead of crashing.
Message files
Ship one YAML file per locale inside your plugin jar and save it to the data folder before loading:lang/en_us.yml
errors.no-permission), values are MiniMessage strings, and an optional top-level prefix entry is prepended by the prefixed send helpers.
Setup
MyPlugin.java
load() reads every .yml in the lang folder and can be called again later to pick up edits (e.g. from a reload command). Missing files are left alone — you ship defaults via saveResource(...) yourself.
Sending messages
MyCommand.java
Locale resolution
For each player,Messages checks (in order): an explicit per-player override, then the client-reported locale trying a full match (en_us) before a language-only match (en), then the default locale. Resolution of a key follows the same graceful chain: the player’s bundle → the default bundle → the raw key itself.
Pair
Messages with Placeholders if you want %target%-style tokens resolved globally across plugins — the example above uses inline MiniMessage TagResolvers, which need no registration.
