Actions and requirements
Every step a click can run, requirements, deny lines and the expressions they use.
Actions
In a screen, action runs on a left click, action-right on a right click and action-shift on a click with sprint held. Steps are separated by ; and run in order. In chest and 3D menus
the same steps are click lines, written in brackets.
| Step | Does |
|---|---|
[PLAYER] spawn | The player runs /spawn (also player: spawn). |
[CONSOLE] give %player_name% diamond 1 | The console runs it (also console: ...). |
[MESSAGE] {success}Done | A chat line to the player. |
[MONEY] take 100, [MONEY] give 100 [currency] | The server's economy, as ExyliaLib's economy.yml says. A take they cannot afford stops every step after it. |
[SERVER] survival | Sends them to another server of the network. |
[TELEPORT] world,0,64,0 | Moves them on this server (commas, since ; separates steps). |
[DELAY] 1s | Waits before the lines after it. |
[CHANCE] 30 | The lines after it run 30% of the time; otherwise the list stops there. |
[HUD] text;group:coins | A notice sliding onto the player's HUD; options anchor:, seconds:, group:. |
[MOMENT] text | A big moment just above the crosshair. |
[BROADCAST] {highlight}%player_name% {letters}won! | One chat line to everybody online. |
[DATA] set daily true | Remembers a value for the player. See Player data. |
[TITLE] ..., [ACTION_BAR] ..., [ACTION] ns:id | ExyliaLib's interaction tokens. |
open shop | Opens another screen (open shop tab=food sets its state). |
close, back | Closes the screen; goes back to the one before. |
sound entity.experience_orb.pickup 0.6 1.2 | A sound for the player only. |
toast success 'Bought' | A short note on the screen (success, error, info, warning). |
confirm 'Buy it for 1,000?' yes=Buy no=Cancel then ... | Asks first; the rest runs only on yes. |
input text name 'Your nickname' then [PLAYER] nick ${name} | Asks for a line of text, then goes on. |
set tab food, toggle open, clear tab | Screen state, read as %tab% or tab in expressions. |
animate shake, animate #balance pop 8t back | Plays an animation once on the clicked element (it needs an id) or on the one named. See Motion. Screens only. |
In chest and 3D menus, [CLOSE] closes the menu and [SCREEN] <id> opens a menu of any form.
A value never becomes another step: a player name with a ; in it stays one word. Quote a word to keep spaces or ; in it: [CONSOLE] say 'hello; world'.
Requirements
require="<expression>" on a clickable element: when it is false the click runs deny instead (or a quiet refusal sound). require-right/deny-right and require-shift/deny-shift gate only
that click.
<card require="balance() >= 50" deny="toast error 'You need 50 coins'; sound entity.villager.no"
action="[MONEY] take 50; [CONSOLE] give %player_name% bread 16; toast success 'Bought 16 bread'">A refusal reads better when the card itself reacts: deny="animate shake; sound entity.villager.no 0.4; toast error 'You need 50 coins'".
The same require and deny work on a whole menu (see Opening and fallbacks) and, in chest menus, on a slot.
Cooldowns
cooldown on a clickable element of a screen makes its action wait between clicks:
| Written | Means |
|---|---|
cooldown="5s" | 5 seconds between clicks of this element (kept under its id). |
cooldown="daily 24h" | A wait called daily, shared by every screen that names it. |
Times are 500ms, 20t, 5s, 10m, 24h, 7d or several together (1h30m). A wait of 5 minutes or more
survives restarts. While it runs, a click plays deny-cooldown instead (by default a refusal sound and a "Ready
again in …" toast in the player's language). A click that its require turned away starts no wait.
<card id="claim" cooldown="daily 24h"
deny-cooldown="animate shake; toast warning ${t('wait', 'Next reward in')} ${fmt.time(cooldown('daily'))}"
action="[CONSOLE] give %player_name% diamond 3; animate pop; toast success 'Claimed'">
<small if="cooldown('daily') > 0">${fmt.time(cooldown('daily'))}</small>
<small else>{success}Claim</small>
</card>cooldown('daily') is the seconds left, 0 when ready, in any expression. The daily rewards example is built on it.
Expressions
| Checks | perm('node'), balance() / balance('points'), has_item('diamond', 16), level(), world(), health(), food(), data('key'), chance(30), cooldown('key') |
| Network | players('survival') (players on that server, as the proxy last counted), players() (the whole network), online('survival') |
| Text | contains(text, 'part'), matches(text, 'regex'), plural(n, 'kill', 'kills') |
| Formatting | fmt.number(x), fmt.time(seconds) |
| Values | %any_placeholder%, numbers, 'text' |
| Operators | == != < <= > >=, and or not, + - * /, a ? b : c |
They work in if="..." (draw or not), in ${...} (any text) and in require alike. Chest and 3D menus use if: and require: with the same expressions.
<small if="balance() >= 50" class="price-ok">50 coins</small>
<small else class="price-short">50 coins</small>Something missing on this page? Tell us on Discord