Documentation
Vextent
Vextent is a scripting language and runtime for Paper servers. You write script files for commands, events, timers, saved data, web requests and incoming webhooks, and reload them without restarting the server.

service and plugin "Vault" is enabled.Vextent has no hard plugin dependencies. These are the plugins its examples are written around. Any plugin that registers a Bukkit service can be reached the same way as Vault.
Install
- Install Java 21 and Paper 1.21.11 from the downloads above, and start Paper once.
- Put
Vextent-V0.0.1.jarinpluginsand restart. Vextent createsplugins/Vextent/scriptsand aconfig.yml. - Add a script and run
/vextent reload. See Your first script. No restart is needed after this.
Topics
- Variables per-player data, lists, declared defaults, creating variables by name
- Events and Commands react to players, create commands with cooldowns and permissions
- Calling web APIs HTTPS requests with JSON, redirects and retries
- Receiving webhooks let websites and bots trigger scripts, with token auth
- Coming from Skript run
.skfiles or convert them - When something breaks reading errors, common fixes
Start here
What it is
Vextent reads script files (.vxt) and turns them into server behaviour: commands, reactions to things players do, timers, saved data, and talking to websites. You do not need to know Java.
It also reads many Skript files (.sk) by translating them, and can convert them into .vxt for you. See Coming from Skript for what that does and does not cover.
Vextent needs Paper 1.21.11 and Java 21.
/vextent errors will say why.Start here
Installing
- Put
Vextent-V0.0.1.jarin your server'spluginsfolder. - Start the server. Vextent creates
plugins/Vextent/with aconfig.ymland ascriptsfolder. - The first time only, it also drops three example scripts into
scripts. They start with a dash (-welcome.vxt), which means switched off. Remove the dash to enable one. - Edit or add scripts, then run
/vextent reload. No restart needed.
What goes where:
| Path | What it is |
|---|---|
plugins/Vextent/scripts/ | Your scripts. Sub-folders are fine; every .vxt (and .sk) file inside is loaded. A file name starting with - is skipped. |
plugins/Vextent/config.yml | Settings and safety limits. See config.yml. |
plugins/Vextent/data/ | Where saved variables live (a JSON file by default). |
plugins/Vextent/converted/ | Output of /vextent convert. |
To do anything with Vextent in game you need the vextent.admin permission (operators have it by default).
Start here
Your first script
Create plugins/Vextent/scripts/hello.vxt with this inside:
on join:
message "&aWelcome, %player's name%!"
command /hello [target: player]:
trigger:
message "Hello there, %target's name otherwise sender's name%"
Run /vextent reload. Join the server and you get the message. Type /hello for a greeting, or /hello SomeoneOnline.
Three things to notice. Indentation (4 spaces) shows what belongs inside what. Text goes in double quotes. Anything between % signs inside the text is calculated and pasted in, like the player's name.
Start here
How a script looks
Indentation
A line ending in a colon opens a block. Everything indented underneath belongs to it. Use spaces or tabs, but stay consistent inside one file.
Comments
Anything after # (outside of quotes) is ignored.
# this is a note to yourself
message "hi" # this too
Text, colours and pasting values in
- Text is in double quotes. To put a quote inside text, double it:
"say ""hi""". &a,&cand the other&codes make colours.&#ff8800makes a hex colour.%something%inside text is replaced by its value:"You have %{coins}% coins". For a real percent sign write%%.- Inside a
%...%you can use variables, properties and maths, but not quote marks outside of{...}. If you need text there, put it in a variable first.
Top-level pieces
The first level of a file can contain these sections. Each has its own chapter.
| Section | Purpose |
|---|---|
on ...: | Run when something happens |
command /name: | Create a command |
function name(...): | Reusable piece of logic |
every ...: / at 06:00: / cron "...": | Run on a schedule |
webhook "/path": | Answer a request from another program |
variable {name}: type = value | Declare a saved variable with a default |
const NAME = value | A fixed value you can use everywhere in the file |
config: | Settings for the script, in one place |
enum Name: A, B, C | A fixed list of names |
database "name": | Send some variables to a different database |
The language
Variables
A variable is a named box that holds a value. The name goes in curly braces.
| Kind | Looks like | Lives |
|---|---|---|
| Local | {_count} | Only inside the block that created it. Gone when the block ends. Fastest. |
| Global | {coins} | Whole server, saved to disk, survives restarts. |
Variable names are not case-sensitive: {Coins} and {coins} are the same box.
Changing them
set {coins} to 10
add 5 to {coins}
remove 2 from {coins}
delete {coins}
If a variable was never set, reading it gives nothing. Use otherwise to supply a fallback:
set {_c} to {coins} otherwise 0
Variables per player (trees)
Put a dot (or ::) in the name to build a tree. Putting a player's UUID in the name gives each player their own boxes:
set {players.%player's uuid%.kills} to 0
add 1 to {players.%player's uuid%.kills}
message "Kills: %{players.%player's uuid%.kills}%"
Use the UUID, not the player name, because names can change. Everything between the percent signs in a variable name is worked out first.
Lists
A name ending in ::* is a list. add puts a new item on the end.
add "apple" to {_fruit::*}
add "pear" to {_fruit::*}
message "I have %size of {_fruit::*}% fruits"
loop {_fruit::*}:
message loop-value
You can also write lists directly: 1, 2 and 3 or [1, 2, 3]. A map (name and value pairs) is written [a: 1, b: 2], and an empty one is [:]. Read an entry with {_m}["a"] or {_m.a}.
{_m.c}. Mixing them in one variable gives confusing sizes.Looping over a tree with sub-branches (loop {stats::*}) gives you the branch names in loop-index. Build the full name yourself to read deeper values: {stats.%loop-index%.kills}.
Declaring a variable with a type and default
At the top of a script you can say what a variable is and what it starts as:
variable {coins}: number = 10
variable {rank}: text = "member"
variable {tags::*}: texts = "new", "player"
- The default is only written when the variable has no value yet, so reloads and restarts never overwrite saved data.
- The default is converted to the type you named. If it cannot be (for example text "abc" as a number) you get a clear error.
- Declarations run before anything else in the script, so
on loadand every other block can rely on them. - The name must be global (no leading
_). The type comes from the list on the values chapter; the type is checked for the default only, not for every later change.
Creating variables by name while running
Sometimes the name is only known while the script runs. These tools take the name as text, using dots or :: between levels:
create variable "players.steve.kills" with value 3
set {_n} to "players.steve.kills"
message "Kills: %variable {_n}%"
if variable {_n} exists:
delete variable {_n}
set {_names::*} to variable names under "players"
| You write | What it does |
|---|---|
create variable "a.b" [with value x] | Creates it (or overwrites it). With no value it is created as true. |
variable "a.b" | Reads it. Gives nothing if missing. |
variable "a.b" exists | True when it has a value. |
delete variable "a.b" | Removes it and everything under it. |
variable names under "a" | List of the next level of names. |
These make global variables only. Local ones ({_x}) cannot be made by name. At most 16 levels deep.
Typed locals, constants, config, enums
let {_n}: integer = 5 # a local with a type
const MAX_HOMES = 3 # fixed, usable as MAX_HOMES
config: # grouped settings
prefix: "[Shop]"
limits:
homes: 3
enum Rank: MEMBER, VIP, ADMIN
Use them as "%MAX_HOMES%", config.prefix, config.limits.homes and Rank.VIP. Constants and config values are worked out when the script loads, so they cannot depend on players or variables.
The language
Values and maths
| Type name | Example |
|---|---|
| text | "hello" |
| number / integer | 5, 2.5 |
| boolean | true, false |
| timespan | 5 seconds, 2 minutes, 10 ticks |
| list / map | [1, 2, 3], [a: 1] |
| player, offlineplayer, entity, livingentity | player, player named "Steve" |
| location, world, block, vector | player's location |
| item, material, inventory | 5 diamond |
| gamemode, entitytype, particle, damagecause, potioneffecttype, enchantment, commandsender | named values from Minecraft |
Put s on a type name for a list of it: texts, players.
Maths and comparisons
set {_x} to 2 + 3 * 4 # 14
set {_y} to 7 / 2 # 3.5
set {_z} to 7 mod 3 # 1
set {_p} to 2 ^ 3 # 8
if {_x} is greater than 10: ...
if {_x} is between 1 and 20: ...
if {_s} contains "abc": ...
if {_s} starts with "a": ...
if {_a} is 5 and {_b} is not 6: ...
if {_v} is set: ...
Comparisons can also be written >, <, >=, <=, ==, !=.
Handy built-in functions
| Group | Functions |
|---|---|
| Numbers | abs floor ceil round sqrt pow min max clamp sum average random randomInt parseNumber |
| Text | upper lower trim capitalize replace split join substring indexOf repeat padLeft format colored stripColor urlencode |
| Lists | sorted reversed shuffled unique first last slice range listOf setOf mapOf coalesce |
| JSON | tojson fromjson jsonParse jsonStringify jsonPretty |
| Time | now (milliseconds since 1970) formatTime seconds minutes ticks toSeconds |
| Minecraft | location offset vector distance item player offlinePlayer world |
Call them like upper("abc") or round(2.567 * 100) / 100. There are also expression forms such as random integer between 1 and 6, random element of {list::*}, size of {list::*}, type of {x}.
The language
Decisions and loops
if {_x} is 4:
message "four"
else if {_x} is 5:
message "five"
else:
message "something else"
loop 3 times: # runs 3 times, loop-value is 1, 2, 3
message "round %loop-value%"
loop {_list::*}: # loop-value is the item, loop-index its position/name
message loop-value
for {_k}, {_v} in {_map}: # keys and values together
message "%{_k}% = %{_v}%"
set {_i} to 0
while {_i} < 3:
add 1 to {_i}
| Word | Meaning |
|---|---|
stop (or exit) | End this whole block of script right here. |
return value | Give a value back from a function (and end it). |
break | Leave the current loop. |
continue | Jump to the next round of the loop. |
A loop is capped by security.max-loop-iterations (default 1,000,000) so a mistake cannot freeze the server. See Limits.
The language
Events
An event block runs every time something happens. The word on is followed by the event name.
on join:
broadcast "&e%player's name% joined!"
on break of diamond ore:
if player doesn't have permission "vip.diamonds":
cancel event
message "&cOnly VIPs can mine diamonds here."
Values that come with an event
Inside the block you can use names tied to the event: player, block, attacker, message and so on. You can also write them with event- in front (event-block). Some can be changed: set message to "..." in a chat event, set join message to "..." in a join event.
To see exactly what an event offers on your server, run /vextent inspect events.
Cancelling
cancel event stops Minecraft from doing the thing (the block stays, the chat message is not sent, no damage is taken). uncancel event reverses it, and event is cancelled checks it. Events that Minecraft does not allow cancelling give an error that says so. By default your block only runs for events that nobody else has cancelled; add even if cancelled after the event name to also see cancelled ones.
Priority
If several plugins react to the same event, with priority high (lowest, low, normal, high, highest, monitor) controls the order. Leave it out unless you have a reason.
Available events
| Group | Names you can write after on |
|---|---|
| Players | join quit kick player death respawn teleport move chat command world change gamemode change toggle sneak start sneaking toggle sprint toggle flight drop pickup consume item held bed enter bed leave fish exp change level change swap hand items advancement resource pack status pre login item break shear bucket empty bucket fill portal jump right click on block left click on block interact right click on entity |
| Blocks | break place block burn block ignite block explode block form block spread block flow piston extend piston retract redstone change block dispense block grow block fade sign change leaves decay block damage |
| Entities | damage attack spawn creature spawn entity explode explosion prime entity target shoot bow projectile launch projectile hit entity tame heal entity pickup item entity change block entity combust breed entity teleport entity drop item item spawn item despawn mount dismount potion splash hunger potion effect change entity resurrect lightning strike hanging break hanging place |
| Inventories | inventory click inventory close inventory open inventory drag craft prepare craft furnace smelt furnace burn furnace extract hopper move enchant brew |
| World and server | world load world unload world save chunk load chunk unload tree grow weather change thunder change time skip portal create server load plugin enable plugin disable server list ping console command |
| Vehicles | vehicle enter vehicle exit vehicle destroy vehicle damage vehicle create |
| Yours | custom event "name", fired from a script with trigger event "name" |
| Script life | on load (script just loaded) and on unload (about to be removed or reloaded) |
Some events accept a filter, for example on break of diamond ore, on right click on chest, on command "spawn". Anything Bukkit fires that is not on this list can be listened to with on event "full.class.Name" but only after you add the class to the Java allow list (see Java and add-ons).
on chat, put anything that touches the world (messages to players, teleports, blocks) inside a sync: block. See Async and threads.Things you can do (effects)
| Group | Lines you can write |
|---|---|
| Messages | message "...", send "..." to player, broadcast "...", send action bar "..." to player, send title "..." with subtitle "..." to player, clear title of player |
| Players | kick player because "...", heal player, feed player, damage player by 4, kill player, teleport player to location, give 5 diamond to player, make player run command "spawn", deny login with "..." (in pre login) |
| World | drop item at location, spawn zombie at location, spawn 3 of zombie at location, strike lightning at location, create explosion of power 2 at location, play sound "..." to player, show 10 flame at location |
| Potions | apply speed to player for 30 seconds, remove potion effect speed from player, clear potion effects of player |
| Screens | open inventory to player, close inventory of player, bossbars (create bossbar, show bossbar, ...), sidebars (show sidebar titled "..." with "line1", "line2" to player), teams (create team, add player to team, ...), advancements (grant advancement) |
| Server | execute console command "..." (can be turned off in config), trigger event "name", log "...", log warning "...", log error "...", save variables |
Use /vextent parse "your line" to check any single line without running it.
The language
Commands
command /pay <target: player> <amount: number>:
description: Send coins to another player
permission: myserver.pay
permission message: &cYou cannot use /pay.
aliases: /send
cooldown: 3 seconds
cooldown message: &cWait %remaining%.
executable by: players
trigger:
if amount <= 0:
message "&cAmount must be above zero."
stop
remove amount from {coins.%player's uuid%}
add amount to {coins.%target's uuid%}
message "&aSent %amount% to %target's name%."
<name: type>is required.[name: type]is optional. Use the name directly in the trigger (target,amount), orarg-1,arg-2. If someone types the wrong thing, they are shown the usage line.senderis whoever ran it.playeris the same when it is a player and gives an error when the console used it, so addexecutable by: playerswhen you useplayer.[name: type...]as the last argument takes all the remaining words.- Options:
description,permission,permission message,aliases,cooldown,cooldown message,usage,executable by(players / console),suggestions, andsubcommandblocks. Cooldowns are per sender; players withvextent.cooldown.bypassskip them.
Subcommands and tab suggestions
command /warp [name: text]:
suggestions:
name: "spawn", "arena"
trigger:
set {_n} to name otherwise "spawn"
message "Warping to %{_n}%"
The suggestions: block gives the tab-complete list for an argument. For commands like /shop buy and /shop sell, put subcommand blocks inside the main command, each with its own trigger::
command /shop:
subcommand buy <item: text>:
trigger:
message "buying %item%"
subcommand sell <item: text>:
trigger:
message "selling %item%"The language
Functions
A function is a named recipe you can use from anywhere in your scripts.
function greet(name: text, punctuation: text = "!") -> text:
return "Hello, %{_name}%%{_punctuation}%"
on join:
message greet(player's name)
message greet(player's name, punctuation: "?")
- Parameters are
name: type. Add= valueto make one optional. Inside the function, use{_name}(or plainname). -> typesays what comes back. Leave it out if nothing does.- You may write several functions with the same name and different parameter types (overloads); the matching one is picked.
- You can pass by position, or by name as in
punctuation: "?". async function ...runs on a background thread.local function ...is private to its file.waitis not allowed inside a function. Useafter 5 seconds:instead.- Recursion works, limited to
security.max-recursion-depth.
The language
Timers and waiting
every 10 minutes:
broadcast "&eRemember to vote!"
every 1 second async:
... # background thread, no world access
at 06:00: # every day at 06:00 server time
broadcast "&bGood morning!"
cron "*/5 * * * *": # minute hour day month weekday
log "five minute tick"
Inside any block
wait 2 seconds # pause here, everything else keeps running
message "two seconds later"
after 10 seconds: # run the indented part later, carry on right now
broadcast "ten seconds passed"
set {countdown} to 5
repeat every 1 second as "countdown": # a repeating task you can stop
broadcast "%{countdown}%"
remove 1 from {countdown}
if {countdown} < 1:
cancel this task
cancel all tasks # stop this script's repeating tasks
Each round of a repeat every block starts with a fresh copy of the local variables, so keep running totals in a global variable like {countdown} above. wait never blocks the server; the script resumes later on the right thread. Timespans are written like 10 ticks (20 ticks = 1 second), 5 seconds, 2 minutes, 1 hour. Reloading a script cancels its waiting and repeating tasks.
The clock for at and cron is checked once a second and fires when the minute changes, so a task never runs twice in the same minute and never runs on startup.
The language
Async and threads
Minecraft's world can only be touched from one thread (the main thread). Slow things, like web requests and database work, must stay off it or the server lags. Vextent gives you two blocks:
async: # background thread
set {_r} to http get "https://example.com/data"
sync: # hop back to the main thread
message "Got status %{_r.status}%"
- Inside
async:you can do maths, variables, web requests and SQL. Anything that touches players, blocks or entities belongs insync:. Vextent refuses to load a script that does this wrong and tells you which line. - Local variables are copied into the block, so changes made in a block do not leak back out. Put results into a global variable or do the next step inside the block.
- Web requests and webhook handlers are covered below.
The language
Handling errors
function risky(n: number) -> number:
if {_n} < 0:
throw "negative"
return {_n}
on load:
try:
log "%risky(1)%"
log "%risky(-1)%"
catch {_e}:
log "caught: %{_e.message}% (%{_e.category}%)"
The caught error has message, category, line and hint. Without try, an error stops that one run of the script, is printed to the console with the file, line, column and a hint, and the server carries on.
Connecting
Saving data
Global variables are saved for you. By default they go into plugins/Vextent/data/variables.json. Changes are written in the background every 30 seconds (performance.save-interval-ticks: 600), when you run save variables, and when the server stops. A hard crash can lose up to one interval.
| type | Good for |
|---|---|
json | Default. Human-readable file. Fine for small servers. |
yaml | Same idea, YAML file. |
sqlite | One database file. Better with lots of variables. |
mysql / mariadb | Shared by several servers. |
memory | Nothing saved. Forgotten at restart. |
Change the default in config.yml under storage.default. To send only some variables elsewhere, declare a database in a script:
database "stats":
type: sqlite
file: stats.db
variables: stats.*
on join:
add 1 to {stats.%player's uuid%.joins}
Variables under stats now live in stats.db. If a database cannot be opened, the script does not load and the error says why; the old version of the script keeps running.
Raw SQL
sql update "CREATE TABLE IF NOT EXISTS bans (name TEXT, reason TEXT)" in "stats"
sql update "INSERT INTO bans VALUES (?, ?)" in "stats" with "Steve", "griefing"
set {_rows::*} to sql query "SELECT * FROM bans WHERE name = ?" in "stats" with "Steve"
Each row comes back as a map with lower-case column names. Values after with are always sent as parameters, never glued into the text, so they cannot break your query. SQL runs on whatever thread called it, so use it inside async: for anything big.
Connecting
Calling web APIs
Scripts can fetch from and send to other websites, for example a Discord webhook or a stats API. Because a script could otherwise send your server's data anywhere, this is off until you list the websites you trust.
Step 1: allow a host
security:
http:
allow:
- api.github.com
- discord.com
- "*.example.org"
Then /vextent reload. A leading *. allows every sub-domain.
Step 2: make the request (always inside async:)
async:
set {_r} to http get "https://api.example.org/player/steve"
if {_r.ok}:
log "name: %{_r.json.name}%"
else:
log warning "failed with %{_r.status}%"
async:
http post "https://api.example.org/event" with body [type: "join", who: "Steve"]
http put "https://api.example.org/x" with body "plain text"
http delete "https://api.example.org/x"
http get "https://api.example.org/me" with headers [Authorization: "Bearer abc"]
Use http get, http delete, http post, http put and http patch. Bodies of post/put/patch come after with body. A list or map body is sent as JSON with the right header added for you; text is sent as is. Add headers with with headers [...] (for get and delete) or and headers [...] (after a body).
What you get back
A map with these entries:
| Entry | Meaning |
|---|---|
status | The HTTP status number, e.g. 200 or 404. |
ok | true when the status is 200 to 299. |
body | The reply as text. |
json | The reply already converted to a map or list, when the server says it is JSON. Otherwise empty. |
headers | Reply headers, names in lower case. |
url | The final address, after any redirects. |
millis | How long it took. |
Read entries like {_r.status} or {_r.json.name}. Two JSON helpers exist: tojson(value) and fromjson(text). urlencode(text) makes text safe to put in an address.
How the connection is protected
- HTTPS only by default. Plain
http://is refused unless you setallow-insecure: true. Connections use TLS 1.3 or 1.2 and the server certificate and host name are checked against Java's trusted certificate list. HTTP/2 is used when the other side supports it. - Host allow-list. Every address is checked, including each redirect. A redirect to a host you have not allowed, or from https down to http, is refused.
- No reaching into your own network. Addresses that resolve to this machine or a private network (127.x, 10.x, 192.168.x, 169.254.x and so on) are refused unless you set
allow-private: true. - Credentials do not follow redirects to other hosts.
AuthorizationandCookieheaders are dropped when a redirect leaves the original host. - Limits. 10 second timeout, 1 MB maximum reply, at most 3 redirects, 120 requests a minute for the whole server. All adjustable.
- Automatic retry.
get,deleteandputretry up to 2 times with a short wait if the connection fails or the server answers 502, 503 or 504.postandpatchnever retry, so nothing is sent twice by accident. - Never on the main thread. A request outside
async:is refused with a message telling you to wrap it. - The server's proxy settings (
-Dhttps.proxyHost=...) are honoured.
Example: tell a Discord channel when someone joins. Replace the address with your own webhook address from Discord.
function notify(text: text):
async:
set {_r} to http post "https://discord.com/api/webhooks/YOUR_ID/YOUR_TOKEN" with body [content: {_text}]
if not {_r.ok}:
log warning "Discord notify failed with status %{_r.status}%"
on join:
notify("%player's name% joined the server")Connecting
Receiving webhooks
The other direction: another program (a voting site, a payment service, your own website or bot) sends a request to your server, and a script reacts. Vextent includes a small built-in web server for this. It is off by default.
Step 1: turn it on
webhooks:
enabled: true
host: 127.0.0.1
port: 8765
token: 'put-a-long-random-secret-here'
- Vextent refuses to start the web server with an empty token unless you also set
allow-anonymous: true. Use a long random token (30+ characters). host: 127.0.0.1means only programs on the same machine can reach it. To accept requests from the internet sethost: 0.0.0.0, open the port in your firewall or hosting panel, and read the security notes below first.- Changing these needs
/vextent reload. The console printsWebhook server listening on ...when it works, and/vextent inspect webhookslists each address.
Step 2: write the script
variable {votes.total}: integer = 0
webhook "/vote" post:
set {_name} to request-json["username"]
if {_name} is not set:
respond with status 400 and "missing username"
stop
add 1 to {votes.total}
add 1 to {votes.%{_name}%}
broadcast "&6%{_name}% just voted! Total votes: %{votes.total}%"
set {_p} to player named {_name}
if {_p} is online:
give 5 diamond to {_p}
respond with status 200 and [ok: true, total: {votes.total}]
webhook "/votes":
respond with [total: {votes.total}]
webhook "/path" post: answers one method (get, post, put, delete or patch). Leave the method out to accept any. The block runs on the main thread, so you can use players and the world directly.
What the script can see about the request
| Name | Holds |
|---|---|
request-body | The raw body as text. |
request-json | The body as a map or list, when the sender says it is JSON. Read with request-json["field"]. |
request-query | The part after ? in the address, as a map. Names are lower-case: request-query["a"]. |
request-headers | Headers as a map, names in lower case. The secret token header is left out. |
request-method, request-path, request-ip | Text. |
Replying
respond with "pong" # status 200, plain text
respond with [ok: true] # status 200, sent as JSON
respond with status 201 and [id: 7]
respond with status 404 and "no such thing"
A list or map reply is sent as JSON, anything else as text. If your script never calls respond, the caller gets {"ok":true}. Call respond before any wait, because the answer is sent as soon as the block first pauses or finishes. If the script takes longer than response-timeout-ms (5 seconds) the caller gets a 504.
Calling it
curl -X POST "http://127.0.0.1:8765/vote?a=hello" \
-H "Authorization: Bearer put-a-long-random-secret-here" \
-H "Content-Type: application/json" \
-d '{"username":"Steve"}'
The secret can be sent as Authorization: Bearer ... or as an X-Vextent-Token header. Without it the caller gets 401.
What protects it
- A secret token, compared in a way that does not leak how many characters matched.
- Optional IP allow-list:
allowed-ips: [203.0.113.5]. - Rate limit per sender address (
max-requests-per-minute, default 120), body size limit (256 KB) and a response time limit. - Unknown paths answer 404 without telling the caller anything about your scripts. Errors inside your script are logged on the console but never sent to the caller.
host: 127.0.0.1 and put a reverse proxy such as Caddy or nginx in front, which also gets you a free certificate; or (2) give Vextent a Java keystore under webhooks.tls.keystore (a .p12 or .jks file in plugins/Vextent/) with its password, and it serves HTTPS itself with TLS 1.3/1.2. The built-in server is meant for light traffic, such as vote sites and bots, not for a public website.The web server runs inside the Minecraft process. If you are on shared hosting, check that your host lets you open the port; many do not.
Connecting
Java and add-ons
Calling Java from a script
Off by default. To turn it on, set security.java-bridge.enabled: true and list each class (or Class#method) a script may touch under security.java-bridge.allow. Anything not listed is refused.
set {_r} to java static "java.lang.Math#max" with 3, 9
There are also java call "Class#method" on object with args and java run "...". The first line above only works once java.lang.Math#max is on the allow list. Treat this as a power tool. Every entry you allow is code a script can run with the server's full permissions.
Other plugins
if plugin "Vault" is enabled:
set {_v} to version of plugin "Vault"
log "Vault version: %{_v}%"
set {_econ} to service "net.milkbowl.vault.economy.Economy"
Writing a Vextent extension (for developers)
A Java plugin can add new events, effects, expressions and types. It depends on Vextent, implements VextentExtension, and registers its syntax through the ExtensionContext it is handed. API version is 1.0. Everything an extension registers is removed again when the extension or its plugin turns off. /vextent extensions lists what is loaded.
Operating
Coming from Skript
Put your .sk files in the same scripts folder. Vextent translates them while loading; it does not run Skript's own code. Common things work: options: substitution ({@name}), variables: defaults, send, chance of 30%, exit loop, arg 1, :: lists, and function return types written with ::.
Anything it cannot translate is skipped, and the console says which line and why. The rest of the file still runs. Skript add-ons, and any syntax not listed in this guide, are not supported.
Converting to Vextent
/vextent convert plugins/Vextent/scripts/shop.sk
/vextent convert plugins/MyOldSkriptFolder
The path is relative to your server folder. Results go to plugins/Vextent/converted/. Lines that could not be converted are commented out with # [vextent] not converted: so you can fix them by hand, and the converted file is checked again before the report. Read the report, test the script, then move it into scripts. Set compatibility.skript: false to ignore .sk files entirely.
Honest summary: this is a translation of common Skript, not a guarantee that every script behaves identically. Test anything important.
Operating
The /vextent command
Needs vextent.admin. Alias: /vxt.
| Command | What it does |
|---|---|
/vextent reload [script] | Re-read config and scripts. Unchanged files are skipped. A script with errors is not swapped in; the previous version keeps running. |
/vextent scripts | List loaded scripts with counts and run times, and any that failed. |
/vextent errors [number|clear] | Load errors and recent runtime errors. Give a number for the full report. |
/vextent debug [on|off] | Extra detail and stack traces. Also enables the debug effect. |
/vextent inspect script|var|functions|events|tasks|storage|webhooks | Look inside the running system. inspect var players.steve shows a variable and what is under it. |
/vextent profile [reset] | Which scripts and triggers use time (turn on performance.profiling). |
/vextent parse <line or script> | Check without running. |
/vextent convert <file.sk|folder> | Skript to Vextent. |
/vextent extensions | Loaded add-ons. |
/vextent version | Version information. |
Operating
config.yml
All of these are optional; the shipped file shows the defaults. Run /vextent reload after changing.
| Key | Default | Meaning |
|---|---|---|
performance.async | true | Allow async: and background tasks. Turn off to run everything on the main thread. |
performance.profiling | false | Measure how long each trigger takes (/vextent profile). |
performance.slow-warning-ms | 50 | Warn when a script holds the main thread longer than this. |
performance.save-interval-ticks | 600 | How often changed variables are written (20 ticks = 1 second). |
security.max-loop-iterations | 1000000 | Largest number of rounds one loop may run. |
security.max-recursion-depth | 256 | How deep functions may call themselves. |
security.max-tasks-per-script | 10000 | Pending waits and repeating tasks per script. |
security.max-event-depth | 32 | Stops a script that triggers itself forever. |
security.max-execution-ms | 0 | Longest a single run may take before being stopped. 0 means no limit. |
security.max-collection-size | 1000000 | Largest list or SQL result. |
security.max-db-ops-per-second | 2000 | Database and web calls per second. |
security.console-commands | true | Allow execute console command. |
security.max-explosion-power | 10.0 | Cap for create explosion. |
security.max-entity-radius | 128 | Cap for "entities within N blocks". |
security.java-bridge.enabled / allow | false / empty | Calling Java from scripts. See Java. |
security.http.allow | empty | Hosts scripts may contact. Empty means web access is off. |
security.http.timeout-ms | 10000 | Give up on a request after this long. |
security.http.max-response-bytes | 1048576 | Largest reply accepted. |
security.http.max-redirects | 3 | Redirects followed. |
security.http.retries | 2 | Extra tries for safe requests (get, delete, put). |
security.http.max-requests-per-minute | 120 | Whole-server cap. 0 for none. |
security.http.allow-private | false | Allow addresses on your own network. |
security.http.allow-insecure | false | Allow plain http://. |
security.http.user-agent | Vextent | Sent with each request. |
webhooks.enabled | false | Run the incoming web server. |
webhooks.host / port | 127.0.0.1 / 8765 | Where it listens. |
webhooks.token | empty | The shared secret. Required unless allow-anonymous. |
webhooks.allow-anonymous | false | Accept requests without a token. Not recommended. |
webhooks.allowed-ips | empty | If set, only these sender addresses are accepted. |
webhooks.max-body-bytes | 262144 | Largest request body. |
webhooks.max-requests-per-minute | 120 | Per sender address. |
webhooks.response-timeout-ms | 5000 | Answer 504 if the script takes longer. |
webhooks.tls.keystore / password | empty | Serve HTTPS with this keystore file. |
compatibility.skript | true | Load .sk files. |
debug.enabled | false | Stack traces and extra logs. |
debug.error-log-size | 200 | How many runtime errors are remembered. |
storage.default.type / file | json / variables.json | Where global variables are saved. |
Operating
When something breaks
Every problem is printed with the same shape: the file, the line, the column, what kind of problem it is, the offending line with a pointer, and a hint.
[Vextent] Script error
File: plugins/Vextent/scripts/shop.vxt
Line: 9
Column: 35
Category: Syntax
ERROR: Unexpected character '''
9 | remove {_amount} from {money.%{_from}'s uuid%}
| ^
Hint: Remove it, or put it inside a text literal.
Category tells you where to look: Syntax (typo or wrong shape), Type (a number was expected and text arrived), Name (unknown word, a suggestion is given), Security (blocked by config), Limit (a safety cap was hit), Thread (world code in the wrong place), Storage, Runtime.
| Symptom | Try |
|---|---|
| Script does not run after editing | /vextent reload, then /vextent errors. A failed reload keeps the old version running, so you may be seeing old behaviour. |
| "Unknown top-level section" | A line is not indented under what it belongs to, or the section name is misspelled. |
| "must not run on the main server thread" | Put the web request in async:. |
| "HTTP access is disabled" | Add the host to security.http.allow. |
| "points to a private or local address" | The site resolves to your own network. Set allow-private: true only if you meant that. |
| Webhook server did not start | Missing webhooks.token, port in use, or your host blocks the port. |
| Webhook answers 401 | The token header is missing or wrong. |
| Webhook answers 404 | Path or method does not match any webhook block. Check /vextent inspect webhooks. |
| Variables vanish on restart | Check storage.default.type is not memory. /vextent inspect storage shows pending writes. |
| "took N ms on the main thread" | A script is doing too much in one go. Move slow work to async: or spread it out with wait. |
Turn on /vextent debug on when you need stack traces to send to someone.
Operating
Limits and honesty
- Safety limits stop accidents, not attackers. Scripts are code written by people you trust. A script with console commands allowed can do anything an operator can. Give
scripts/the same care as your plugins folder. - Speed. Measured on one cloud machine with the interpreter alone (no server): about 14 ns per round of an empty loop, 21 ns with a bit of maths, 44 ns to write a global variable, 1.6 µs to append to a list. That is useful for comparing your own changes; it is not a promise about your server, and no comparison against Skript was run. Real cost is usually dominated by the Minecraft calls your script makes.
- Unverified areas. The long list of player events, SQL databases, the Java bridge and add-on API are built and unit-tested, but not yet exercised by real players or third-party plugins.
- Declared variable types are checked on the default value only.
- Webhook scripts that
waitbefore replying answer with what was set so far.
Operating
Cheat sheet
# files
plugins/Vextent/scripts/*.vxt -name.vxt = off /vextent reload
# variables
{_local} {global} {tree.%uuid%.x} {list::*}
variable {coins}: number = 0
create variable "a.b" with value 1
# flow
if / else if / else loop N times: loop {list::*}: for {_k}, {_v} in {_m}:
while cond: stop return x break continue try: / catch {_e}:
# when
on join: on break of stone: cancel event
command /x <a: player> [b: number]: (permission, cooldown, trigger:)
function f(a: text, b: number = 1) -> text:
every 5 minutes: at 06:00: cron "*/5 * * * *":
wait 2 seconds after 5 seconds: repeat every 1 second as "x":
# threads
async: sync:
# outside world
http get/post/put/patch/delete "https://..." [with body x] [with headers m]
webhook "/path" post: request-json["k"] respond with status 200 and [ok: true]
# admin
/vextent reload | scripts | errors | inspect ... | parse ... | convert ...Vextent by DeadByte. These docs describe version V0.0.1.
