HyperScript
Docs

Overview and architecture

Plugin folder/plugins/HyperScript/
Scripts/plugins/HyperScript/scripts/*.hs
Settings/plugins/HyperScript/config.yml
Saved variables/plugins/HyperScript/data.json, plus MySQL or SQLite if configured
Backups/plugins/HyperScript/Backups/
Admin command/hyperscript <reload|list|status|version|check|disable|enable|remake|variables|timings|errors|speed|debug|test|search|install|update|docs|new> (alias /hs, permission hyperscript.admin, default op)
RequirementsPaper or Spigot 1.16.5+, Java 8+

What is in the box

FeatureSummary
Commands and eventsDeclare commands with permissions, aliases and checked arguments; over 80 events; react to joins, chat, damage, jumps, block breaks, mob spawns, inventory clicks and more, with each event's details available as plain words such as attacker and message
Cooldowns and timerscooldown: 1 hour on any command or event; every 5 seconds: for repeating work; every day at 18:00: for the clock
On-screen textAction bars, titles with fade timings, boss bars, per-player sidebar scoreboards
Variables{name} is saved and shared by every script, {_name} lasts for one run; a name that starts with a player, such as {%player%.coins}, is that player's own. They hold numbers, text, lists, items, durations and locations
Functions and optionsfunction reward({_who}, {_amount}): for any script to call, local function for one file; options: for settings named once at the top of a file
Playersheal, feed, health, levels, game mode, flight, potion effects, freeze, vanish, pushing, and thirty more things to read or set
EntitiesKeep a summoned mob in a variable: name it, heal it, send it after someone, remove it
Datesnow, now + 1 day, time since, dates written out any way you like
Error handlingtry: and on error: for lines that might fail
Top liststop 10 players by {coins} across everyone who has ever played
Teams and moderationColoured teams with tags; kick, ban ... for 7 days, and on player login: to turn players away
Inventoriesif player has 5 diamond:, remove 5 diamond from player
Custom itemsitem magic wand: names an item once for every script, recipe for magic wand: makes it craftable; give player 1 diamond sword named "&6Excalibur" with lore "..." enchanted with sharpness 5; set what a player wears and holds; hidden tags so a script recognises its own items
ChatClickable and hoverable messages: send "&a[Home]" with click command "/home"
Sounds and resource packsplay sound ... with pitch 1.8 and volume 1.0; send resource pack with response events
Worlds and regionsSet time and weather; define box regions and test region at <location>
Web requestssend get request to ... and send post request to ... from async: blocks
Text and filessplit, join, replace, slicing, parse "52" as number; create, read and write text files in the plugin folder
Lists and loops[1, 2, 3], sorted, filter ... where, for each, loop N times, loop from 1 to 10, loop all players, loop-value, break, continue, switch
GUIsChest menus with clickable slots, written inline; pages and refreshing built in
Async blocksasync: moves heavy work off the server thread, sync: comes back
Server list and chatMOTD, player counts and icon in the server list; tab list header and footer; join, quit and chat formats
Waiting and loopswait 5 seconds inside any trigger; loop, for each and while
World effectsFloating text and blocks (display entities), particles with hex colours, particle circles, spheres and lines
DiscordWebhooks, and through a bot: slash commands, messages sent to a channel, and reacting to what is written there
Other pluginsMoney through Vault (balance of player); PlaceholderAPI placeholders in scripts, and script variables as placeholders for other plugins
Hot reloadingScripts recompile when the file is saved
Update checkOperators are told on joining when a newer version is out
Characters and tradingcreate npc "Guide" at ... with on npc click, and the villager trading window with offers of your own
Parties and queuesPlayers who belong together, and on queue "arena" of 4: when enough are waiting
Enchantments and advancementsenchantment lifesteal: and advancement "First blood": blocks of your own
The databaserun sql and sql rows of on the database the variables are in; shared. variables every server of a network sees
A web address of its ownon web request "vote": for websites and other programs to call
Finding scripts/hyperscript search, install and update fetch scripts and new versions from the website
Testingtest "...": blocks run with /hyperscript test, and /hyperscript debug shows a script line by line
AddonsOther plugins can add statements, values and events to the language
Storagedata.json, optionally with a CSV file, SQLite, H2 or MySQL beside it and automatic fallback, plus scheduled backups

How a script runs

 main.hs ──► Lexer ──► ScriptParser ──► execution tree ──► registered once ──► runs on every event
             (text)    (one pass,        (Java objects,     (commands and
                        at load)         names resolved)    event listeners)

HyperScript does all of its text work once, when a script is loaded. What runs afterwards is a tree of small Java objects, one per statement or operator, that call each other directly.

To be precise about the word "compile": HyperScript compiles to an in-memory execution tree, not to JVM bytecode. The speed comes from moving work out of the hot path, not from code generation:

WorkA naive line-by-line interpreterHyperScript
Parsing a lineEvery time the line runsOnce, at load
Local variables ({_reward})Map lookup by nameArray slot assigned at load
Placeholders (%player.name%)String search and replace per messageBound to a resolver at load; the string is pre-split into parts
Constant math (20 * 60 * 5)Recomputed each runFolded to a single constant at load
Syntax errorsDiscovered when the line is reachedReported at load with a line number; the file is rejected
Unused eventsOften listened to anywayNot registered at all
Persistent variablesDisk or database per accessIn-memory map; storage I/O on a background thread

A few consequences worth knowing:

Why it survives server updates

The language core (dev.hyperscript.lang, dev.hyperscript.runtime) contains no Bukkit imports. Everything the server provides goes through one interface, ScriptHost. The Bukkit side is compiled against the 1.16.5 API, the oldest supported version, with no version-specific (net.minecraft) code. The places where versions genuinely differ are handled at run time:

FeatureDifference between versionsHow HyperScript handles it
%server.tps%getTPS() exists on Paper onlyMeasures tick rate itself with a scheduler task
%player.ping%Player#getPing() exists from 1.17Uses it when present, otherwise reads the value reflectively; -1 if neither works
Registering commands at run timeNo public Bukkit APIReaches the server's command map reflectively
Display entitiesAdded in 1.19.4Used reflectively when present; floating text falls back to an invisible armour stand
Coloured dust particleRenamed from REDSTONE to DUST in 1.20.5Looks up whichever name the server has
GUI click handlingInventoryView changed from a class to an interface in 1.21Never touches InventoryView