Skip to content

messages.yml

Edit, disable and translate every message OptimalGifts sends, plus optional screen titles and action bars.

Every message lives in messages.yml. Each supports legacy & codes, &#hex, MiniMessage and (with PlaceholderAPI) %...%. After editing, run /giftsadmin reload.

Messages:
GIFT-CLAIMED:
Message:
Enabled: true
Value:
- "&5[&d&lGifts&5] &7You opened the &f{gift} &7and received &f{reward}&7."
  • Enabled: false silences the chat message.
  • Value is a single string or a list. Every line is sent (the admin help panel uses this).
  • Start a line with [center] to center it in chat.
  • Keep the {tokens} intact and don’t rename the message keys.

Missing keys are written back with their defaults the next time the file loads, so you can delete a block to reset it. PROFILE-LOAD-FAILED is not in the shipped file and is added this way on first start.

Any message can also show a title and subtitle on the player’s screen. Add a Title: block next to Message::

Messages:
GIFT-UNLOCKED:
Message:
Enabled: true
Value:
- "&5[&d&lGifts&5] &7You can now claim &fGift #{number} &7in &f/gifts&7!"
Title:
Enabled: true
Title: "&2&m━━━&r &a&lGift &f&l#{number} &a&lUnlocked &2&m━━━&r"
Sub-Title: "&7Claim your reward in &f/gifts&7!"
Key Default Description
Enabled true false hides only the title; the chat message is unaffected.
Title "" The large center line.
Sub-Title "" The smaller line beneath it.
Fade-In 10 Fade-in time in ticks.
Stay 70 How long the title stays, in ticks.
Fade-Out 20 Fade-out time in ticks.

The same {tokens} the message uses resolve in the title and subtitle. Titles only show to players. GIFT-UNLOCKED ships with a title enabled; add a Title: block to any other key the same way.

A message can also show one line above the hotbar with an Action-Bar: block:

Action-Bar:
Enabled: true
Value: "&aGift #{number} unlocked!"

None of the default messages use one.

Key Sent when
PLAYER-ONLY The console runs /gifts.
NO-PERMISSION The sender lacks optimalgifts.use or optimalgifts.admin.
INVALID-PLAYER An admin command targets a player who is not online (addtime) or never joined (reset).
PROFILE-LOAD-FAILED A player’s gift data could not be loaded while logging in. Shown as the login refusal / kick screen.
GIFT-LOCKED A player clicks a locked gift.
GIFT-ALREADY-CLAIMED A player clicks a gift already claimed today.
GIFT-CLAIMED A gift is claimed.
GIFT-UNLOCKED A gift reaches its playtime requirement. Ships with a title.
GIFTS-RESET /giftsadmin reset succeeds.
PLAYTIME-ADDED /giftsadmin addtime succeeds.
INVALID-DURATION /giftsadmin addtime gets a duration it can’t read.
RELOAD /giftsadmin reload finishes.
GIFTS-ADMIN-HELP /giftsadmin with no, an unknown or an incomplete subcommand.
Message Tokens
GIFT-LOCKED {gift}, {number}, {unlocks-in}
GIFT-ALREADY-CLAIMED {gift}, {number}, {refreshes-in}
GIFT-CLAIMED {gift}, {number}, {reward}
GIFT-UNLOCKED {gift}, {number}
INVALID-PLAYER, GIFTS-RESET {player}
PLAYTIME-ADDED {player}, {playtime} (the amount added)
INVALID-DURATION {duration}
RELOAD {ms} (reload time in milliseconds)

A token only resolves in the messages that provide it: {refreshes-in} in GIFT-CLAIMED, for example, is left as literal text.

  • GIFT-UNLOCKED is sent by a check that runs every second, the moment a gift becomes claimable, not when the menu is opened. Disabling it (and setting its GIFT-UNLOCKED sound to "" in config.yml) makes unlocks silent.
  • PlaceholderAPI placeholders are resolved for player targets. Messages sent to the console skip them.