TextComponent - MiniMessage (Expression) — SkBee

Addon: SkBee · Category: Expression · Since: 2.4.0

Syntax

mini[ ]message from %string% [with [resolver[s]] %-tagresolvers%]

Description

Get a mini message from a string. These messages are still components, which you can still apply hover/click events to. You can also add optional tag resolvers. Essential you create a resolver to replace `<someString>` in mini message with something else (See examples for more details). For more info check out the [**Mini Message Format**](https://docs.papermc.io/adventure/minimessage/format/) page.

Examples

set {_m} to mini message from "<rainbow>this is a rainbow message"
set {_m} to mini message from "<gradient:##F30A0A:##0A2AF3>PRETTY MESSAGE FROM RED TO BLUE"
set {_m} to mini message from "<red>This is a <green>test!"
send component mini message from "<red>This is a <green>test!" to all players

# Create a component
set {_t} to translate component of player's tool
add hover event showing player's tool to {_t}
# Use this component in the resolver to replace "<item>" in the mini message
set {_r} to resolver("item", {_t})
# Setup the mini message with the replacement placeholder
set {_m} to mini message from "<rainbow> Hey guys check out my <item> aint she a beaut?" with {_r}
send component {_m}

View source