-
Notifications
You must be signed in to change notification settings - Fork 1
Placeholder System
This system allows the creation and management of custom placeholders through YAML files, organized within a directory called placeholders. Files can be structured into multiple subdirectories and contain placeholders with different formats and functionalities.
placeholders:
example:
# accepts arguments
value: "<green>Hello {0}"
type: "text"
color-example:
# type: legacy, console
value: "<yellow>Test color example"
type: "color_text"
prefix:
value: "<gradient:gold:yellow><b>MyServer</b></gradient>"
type: "text"YAML files can be organized into any number of subdirectories within MyMessage/placeholders/, providing a flexible structure.
Example file structure:
MyMessage/
|
placeholders/
├── global.yml
├── messages/
│ ├── errors.yml
│ ├── notifications.yml
├── custom/
│ ├── example.yml Each YAML file must follow this format:
placeholders:
<placeholder-key>:
type: <available-types>
value: "Example value"-
<placeholder-key>: Name of the placeholder used in the system (No use snake case ->my_placeholder). -
<available-types>: Placeholder type. - value: Placeholder content.
text
This type allows defining placeholders with dynamic values, supporting arguments in the message.
Example Configuration
placeholders:
greeting:
type: text
value: "Hello {0}, {1}!"Expected Result
Placeholder: %mm_greeting%
Without arguments: "Hello {0}, {1}!".
With arguments: "Hello John, welcome!" (%mm_greeting_args:John;welcome%).
color_text
This type allows defining placeholders with customizable color formats. Depending on the chosen format (legacy, console or minimessage), the output will change.
Example Configuration
placeholders:
welcome-message:
type: color_text
value: "<red>Welcome!"Available Formats
| Placeholder | Format | Output |
|---|---|---|
| %mm_welcome-message_legacy% | legacy | &cWelcome |
| %mm_welcome-message_console% | console | §cWelcome |
| %mm_welcome-message_minimessage% | minimessage | <red>Welcome |