scriptsREADME.md
PixelScriptPixelScript

Ship server features while the server is running.

Write JavaScript or TypeScript against the real Bukkit/Paper API. Save, and the change is live before you alt-tab back.

Documentation
An IDE next to a running Minecraft server. The IDE completes methods on a Java BufferedImage. The in-game chat lists three scripts unloading and loading again.
A script that draws an image in the world. The IDE completes a Java class from the generated type definitions. The chat on the right shows the save being reloaded.

A feature is a file. An update is a save.

The slow part of plugin development is the loop around the code. PixelScript removes it.

  • Build at the speed of a save. A Java plugin change means rebuild, restart, reconnect. Here you save the file. The script reloads in milliseconds and you test it in the same session.
  • Ship without a release. Add one line to a watcher to turn a feature on. Remove the line to pull it off a running server. There is no jar to build and no deploy to schedule.
  • Fix bugs while players are online. Found a bug in production? Patch the file. Nobody is kicked, and nobody waits for the next release.
import { ACCENT, MUTED, mm } from '@/lib/chat/messages';

const REQUIRED_FRACTION = 0.33;
const MORNING = 1000;

// Vanilla needs every player in a bed before it skips the night.
// This counts sleepers per world instead.
registerListener($.PlayerBedEnterEvent, (event) => {
  const player = event.getPlayer();

  // The player is not counted as sleeping until the tick after the event.
  Scheduler.runSyncLater(() => {
    if (player.isOnline() && player.isSleeping()) {
      tally(player.getWorld());
    }
  }, 1);
});

That listener is most of a feature. Open the whole file: or browse the workspace in the explorer.

Coming from Java

It's Java with JavaScript syntax. Your code compiles to JVM bytecode and calls the same Bukkit objects a plugin does. The API, your patterns and your Java libraries all still apply.

Coming from Skript

PixelScript is nothing like Skript. There's no simplified syntax and no prebuilt GUI helpers. You write real code against the real API, and you get full control.

How it works

There's no build step and no separate process. Your scripts load into the server's own JVM. A save is a targeted reload, not a restart.

Your scripts

Plain .js and .ts files on disk, in whatever tree you want. A file watcher notices when one changes.

The runtime

TypeScript is compiled first. Then everything is compiled to JVM bytecode, not interpreted. The changed script and its dependents are torn down and rebuilt. Their commands, listeners and tasks are unregistered with them.

The live server

The new version registers itself against the real Bukkit/Paper API. Players stay connected and the world stays loaded. Nothing else on the server is touched.

Server console: [PixelScript] Loading new script: main.js. Script 'main.js' loaded (7ms).

Your code runs inside the server. There's no bridge to marshal across and no API subset to work around. Everything a Java plugin can do, a script can do. Same objects, same events, same services.

What you get

A runtime that stays predictable on a live server. Each entry links to code you can open.

Save the file, the change is live

Save a file and only that script reloads. Its commands, listeners and scheduled tasks are unregistered and registered again for you. The new version picks up the players who are already online, so you test the change without rejoining.

In-game chat listing scripts as they reload, each with its load time
Every script reports its load time in chat. A slow reload has an obvious culprit.

A release is one line

Every script is root, watched or imported. A watched script is a barrier: editing one feature never reloads the others. That makes a release one line. Add the line to roll a feature out, remove it to pull the feature off a running server.

The /script tree command printing the dependency tree with per-script load times
Run /script tree on a live server to print the tree with load times.

Autocomplete against your own server

PixelScript writes a definitions.d.ts for the Java classes your scripts touch. Your IDE completes against the exact Bukkit version you run. Write .ts where types help, and mix it freely with .js.

An IDE completing members of java.lang.System from the generated definitions file
The definitions come from your classpath, not from a hand-written stub.

Every class on the classpath

Bukkit, Scheduler, Sql, Redis, DataFile, registerCommand, registerListener and fetch are globals. Everything else is one Script.loadClass away. Hook other plugins natively, and pull in any Java library at runtime from a jar or from Maven.

A Java proxy that never goes stale

Describe the contract once as a Java interface and implement it in JavaScript. Your Java plugin gets a real, typed proxy. After a reload, the proxy forwards to the new implementation on its own.

Shared modules and state that lasts

An imported module is one shared instance for every script that imports it. That's how a database layer or a cache stays one thing. State that has to outlive a reload goes in StaticStorage or a GlobalMap.

Ask the server what it's doing

Timings are collected for listeners, commands, tasks, queries and class loads. Built-in commands print the load tree, what each script registered, and where the time went. A slow feature is something you look up, not something you argue about.

The /script info output showing load time, parent scripts, extensions and profiler data
/script info prints load time, parents, everything the script registered, and timings per operation.
The profiler showing average and min-max timings next to a Scheduler.runAsync call and an Sql.makeUpdate call
The profiler puts the timings on the lines that caused them.

Measured, not claimed

Four workloads, each written once in PixelScript and once in Skript. Both run on the same Paper server, in the same JVM, in the same run.

51 to 271×

faster than Skript when the work is the language: loops, strings, collections and function calls. Your code is JIT-compiled JVM bytecode. Nothing is interpreted.

1.9 to 2.8×

faster than Skript when the Bukkit call dominates. Nobody outruns the server, so we show both numbers.

Work dominated by the language

Loops, arithmetic, strings, collections, function calls. Nothing but the runtime.

Arithmetic150,000 iterations271× faster per iteration

sqrt, multiply, modulo and floating point accumulation. No allocation, no API.

PixelScript
10.1 ns
Skript
2.74 µs
Runtime10,000 iterations51× faster per iteration

String building, list append, keyed map put/get and user-defined function calls.

PixelScript
159 ns
Skript
8.09 µs

Work dominated by the Bukkit call underneath

Both languages wait on the same server code, so the gap narrows.

Block writes4,096 blocks2.8× faster per block

Writing and reading back a 16x16x16 region through the Bukkit block API.

PixelScript
1.92 µs
Skript
5.31 µs
Object churn2,000 items1.9× faster per item

ItemStack and ItemMeta creation, display name, lore, Location construction and distance.

PixelScript
3.88 µs
Skript
7.35 µs

Bars show time per unit of work on a log scale. Shorter is better.

Dispatch is subtracted.

Each suite starts from a Bukkit command. That costs the server 100 to 180 µs before any benchmark code runs, and it's the noisiest number in the set. We measure it per language and take it out of every figure above.

Scale matters more than the ratio.

A ratio on top of a few nanoseconds is still a few nanoseconds. The gap shows up in your MSPT on language-bound work. A loop at 10 ns per iteration is a tick you never notice. At 2.7 µs, you do.

Paper 26.1.2, Skript 2.16.0, JDK 25, 24-core Linux. Median of 36 invocations. Every implementation reports a checksum, and the report refuses to compare results when the checksums differ.

Documentation

Read all of it before you commit to anything. Nothing is behind a login.

  • Tutorial
    Your work environment, project setup and the core concepts, in the order you need them.
  • API reference
    Every global the runtime binds, with signatures, threading notes and worked examples.
  • Full documentation
    Specifications, tips and the quirks worth knowing before you hit them in production.

Using an AI assistant?

Coding agents already write JavaScript. What they don't know is the runtime: the load tree, the globals and the threading rules. One command adds a condensed reference and the full docs to your project.

git clone --depth 1 \
  https://github.com/pixelib/pixelscript-docs .pixelscript-docs \
  && cp .pixelscript-docs/CLAUDE.md ./CLAUDE.md

Onboard your AI assistant

Request access

We onboard new servers in waves. Ask for access now and read the docs while you wait.

Markdown