-
Notifications
You must be signed in to change notification settings - Fork 0
Built‐in commands and functions
If you don't want to handle donations via your own code, you can use this section.
If you want to work with this, make sure the enable-builtin-commands section is set to true.
Built-in commands are minecraft commands that will be executed on behalf of the console when a donation is received.
The syntax is exactly the same as the syntax of Minecraft commands, except that there is no slash at the beginning of the command.
Built-in functions are special functions that will also be executed on behalf of the plugin when a donation is received, but unlike commands, these functions are provided by the plugin.
They have the following syntax: "[function_name] params..."
| Function | Syntax | Parameter | Description | Default Value |
|---|---|---|---|---|
[sound] |
[sound] <sound_id> [<source_category>] [<volume>] [<pitch>] [<target>] |
sound_id |
ID of Minecraft sound in the format namespace:id
|
- |
source_category (Optional)
|
Name of Minecraft source sound category. Possible values: ambient, block, hostile, master, music, neutral, player, record, voice, weather
|
master |
||
volume (Optional)
|
Volume of the sound being played. Possible values: float between 0.0 and 1.0
|
1.0 |
||
pitch (Optional)
|
Pitch of the sound being played. Possible values: float between 0.5 and 2.0
|
1.0 |
||
target (Optional)
|
To whom the sound will be played. Possible values: player's nickname (e.g. Nickname) or @a (all online players) |
@a |
||
[message] |
[message] <target> <text> |
target |
To whom the message will be sent. Nickname or @a
|
- |
text |
The text of the message that will be sent. May contain MiniMessage formatting. | - | ||
[title] |
[title] <target> [<text>] |
target |
To whom the title message will be sent. Nickname or @a
|
- |
text (Optional)
|
The text of the title message. May contain MiniMessage formatting. Possible values: any string. | empty string | ||
[subtitle] |
[subtitle] <target> <text> |
target |
To whom the subtitle message will be sent. Nickname or @a
|
- |
text |
The text of the subtitle message. May contain MiniMessage formatting. Note: Display requires the title to also be displayed. You can use the [title] function with an empty string. |
- | ||
[times] |
[times] <fadeIn> <stay> <fadeOut> |
fadeIn |
Time (in ticks) for the title/subtitle to fade in. | - |
stay |
Time (in ticks) for the title/subtitle to remain on screen. | - | ||
fadeOut |
Time (in ticks) for the title/subtitle to fade out. | - | ||
[actionbar] |
[actionbar] <target> <text> |
target |
To whom the actionbar message will be sent. Nickname or @a
|
- |
text |
The text of the actionbar message. May contain MiniMessage formatting. | - | ||
[effect] |
[effect] <target> <effect_id> <time> [<level>] [<ambient>] [<particles>] [<icon>] |
target |
To whom the potion effect will be applied. Nickname or @a
|
- |
effect_id |
ID of Minecraft potion effect in the format namespace:id
|
- | ||
time |
Time (in ticks) during which the effect will last. | - | ||
level (Optional)
|
The level of the effect. A value of 0 corresponds to level 1. Possible values: any integer between 0 and 255. |
0 |
||
ambient (Optional)
|
Whether to display particles in a reduced and translucent form. Possible values: true or false. |
false |
||
particles (Optional)
|
Whether to show effect particles. Possible values: true or false. |
true |
||
icon (Optional)
|
Whether to show the effect icon in the player's interface. Possible values: true or false. |
true |
When you receive a donation, you have the opportunity to use information associated with the current donation. Embedded playholders are available for this purpose.
They have the following syntax: "$placeholder_name$". All occurrences of such a string will be replaced with the corresponding value it provides.
-
$sender$- Sender's username. Example:ProTerUga -
$amount$- Donation amount (numeric). Example:5.00 -
$currency$- Currency code. Example:USD,EUR,RUB -
$message$- Donation message (can be empty). Example:Hello! Great server! -
$recipient_amount$- The amount of the donation converted into the recipient's currency. Example:123.45,1000.0
Using PlaceholderAPI
Also you can use placeholders of PlaceholderAPI. This will require a working PlaceholderAPI plugin installed on your server. Parsing is only performed on --null.
Here are some useful extensions to solve your problems:
The basic principle of operation of built-in commands and functions is that they are all executed sequentially, from top to bottom.
commands:
- "[sound] minecraft:entity.player.levelup music 1.0 0.5 $sender$"
- "[message] @a Test <gradient:#ffff00:#ff00ff>DONATION</gradient>!!! <#ff5555>Test \"red\" <reset>and <yellow><bold><italic>YeLlOw<reset><br>$message$"
- "[times] @a 10 100 10"
- "[title] @a <gradient:#fce362:#d14364>>> Donation! <<</gradient>"
- "[subtitle] @a <bold>$sender$<reset> <gray>- <aqua>$amount$ $currency$"
- "[actionbar] @a <green><underlined>+$amount$⛀"
- "[effect] @a minecraft:levitation 100 0"
- give @a minecraft:diamond 4
- tellraw $sender$ {"text":"❤ Thanks for donation!","color":"green"}
Getting Started
Advanced usage