← All versions
HyperScript 1.5.2
Added
Server list
- New event
on server ping, fired when a client refreshes its server list.
set motd to "<line 1>\n<line 2>", set max players to <n>, set server icon to "<path>.png" (Spigot and Paper).
set shown players to <n>, set player list to "<line>", "<line>" (the hover text) and hide player count (Paper only; on Spigot they log one warning and do nothing).
- Placeholders
%{server.motd}% and %{event.address}%.
random item of <list>, for rotating MOTDs and anything else.
Tab list, names and chat
set tab header of <who> to <text> and set tab footer of <who> to <text>.
set join message to <text>, set quit message to <text>, hide join message, hide quit message.
set chat format to <text> and set chat message to <text> in on player chat.
set display name of <who> to <text> (chat and tab list name).
Language
wait <duration>: pauses a trigger and carries on afterwards, anywhere, including inside if, loops, GUI click blocks and async:. Local variables are kept.
while <condition>: loops. A loop that goes round 100,000 times without a wait is stopped with an error, so it cannot freeze the server.
json value "<path>" of <text>: reads values out of JSON, such as web API answers. Paths use dots; list positions count from 1.
Other
- The demo script gains
/countdown (while and wait), /lookup now reads its answer with json value, and there is a commented-out block for the server list, tab list and chat format.
- The Docs page of the website has new topics: Waiting, Server list, and Tab list, names and chat.
Limits worth knowing
- The name above a player's head cannot be changed;
set display name affects chat and the tab list only.
on server ping has no player and runs off the server thread; keep it to a few set lines.
- After a
wait, the event that started the trigger is over, so cancel event and statements such as set join message no longer do anything.
- Waits do not survive a server restart or a script reload.