Run Bedrock behavior pack scripts
Started 2026-11-16. This plan is a working document: tick slices off, and add or reshape them as the work teaches us things. Nothing past slice 2 starts before the plan is approved.
Goal
Unmodified Bedrock add-ons whose behavior packs carry @minecraft/server scripts run on JSPrismarine and behave as they do on the pinned Bedrock Dedicated Server (BDS). Script packs become JSPrismarine's primary plugin format.
The decisions that carry it:
- Each level, which is one Bedrock world with all its dimensions, runs its packs' scripts in one embedded QuickJS runtime on the thread its worlds tick on. Before-events are guards and after-events flush at the end of the tick (ADR 0020, ADR 0015).
- The watchdog counts steps, not milliseconds, and scripts are part of replay (ADR 0021).
- The API's shape is generated from
bedrock-samplesmetadata, and only behavior is written by hand (ADR 0022). - Bellard's QuickJS is bound through one C layer of our own, over
node:ffiand scriptc's FFI (ADR 0023).
What done looks like:
- A pack copied from a BDS server, with its
config/folder, loads on JSP without edits. - A pack gets the newest stable minor of the
@minecraft/servermajor version it declares, as on BDS. - The
scripting.*parity families run each scenario's pack on BDS and on JSP and finds the same events, return values, errors and world changes. - The packs in the add-on corpus run, milestone by milestone.
- A pack can use JSP-only features through an undeclared
import('@jsprismarine/server')and still load on BDS, where the import rejects. - Dynamic properties and scoreboards survive a world moved between BDS and JSP in both directions.
/reloadand the Minecraft Bedrock Debugger for VS Code work as they do on BDS.
Out of scope for now:
@minecraft/server-editorand the editor experience.- Scripts in resource packs. The server has nothing to run for them.
- Marketplace and other closed packs as test fixtures.
What we know
The facts and their sources are in bedrock-script-api.md. Section 6 of bedrock-addons-and-custom-content.md covers the Script API's place among add-on features. The ones the plan rests on:
- BDS embeds an older QuickJS from Bellard's line: no
Intl, no iterator helpers, noFloat16Array, noevaland nonew Functionfrom a string. - BDS refuses to load a pack that declares a module it does not know, even with
"optional": true. An undeclaredimport()of an unknown module loads the pack and rejects the promise. That is the detection mechanism for@jsprismarine/server. - BDS serves the newest stable minor of each major version: a pack declaring 2.0.0 sees 2.10.0.
- AddonBridge, a PowerNukkitX plugin with no license, runs part of the API in GraalJS. Endstone's Node.js plugin swaps the engine inside BDS. No other third-party server runs these scripts.
- After-events, system tasks and promise jobs flush at the end of the tick, in a loop Microsoft documents. Before-events and custom command callbacks run under restricted execution.
- Version 1 and version 2 scripts start differently: early execution and
startupfor version 2,worldInitializefor version 1, andworldLoadfor both after the first tick. - Dynamic properties are one little-endian NBT compound under the LevelDB key
DynamicProperties, with a child compound per pack header UUID. - BDS's watchdog runs on the wall clock, and a caught stack overflow still shuts the server down by default.
- A C layer over quickjs-ng, bound with
node:ffi, called back into TypeScript synchronously on the main thread and in a worker, and its step budget stopped a loop at the same step every run. - Eight of the 14 corpus candidates depend on a beta
@minecraft/server.
2026-11-18: the host moved to BDS 1.26.60.6 and bedrock-samples v1.26.60.5. @minecraft/server 2.11.0 is now stable, so a pack declaring 2.0.0 gets 559 exports, and the shipped beta is 2.12.0-beta with 601. @minecraft/server-ui went to 2.3.0 stable and 2.4.0-beta. The new members, such as block named ticks, BlockEntityStorageComponent, crafting recipe components and playerItemAttackEntity, have no behavior yet. Canopy and Construct declare 2.12.0-beta, so they load on the pinned server now. Every scripting golden was recaptured: the engine's globals did not change, EffectTypes lists minecraft:freezing, and a custom component's params come back in an order that is neither the JSON's nor sorted. The comparison ignores key order, so no row records that.
Shape
@jsprismarine/script-host (packages/script-host) owns the runtime. @jsprismarine/prismarine depends on it, never the other way. Inside the package:
- The native layer. Bellard's QuickJS at a pinned version, the debugger patch, and our C layer, built per platform as ADR 0023 describes.
- The engine binding. One TypeScript wrapper per runtime over the C layer: handles, the host dispatch, the step budget and the allocation limit.
- The generated shape. Modules, versions, classes, members, validation, enums, errors and privileges, generated from
metadata/script_modulesby a script in the package. - The pack loader. It reads
type: "script"modules from the world's behavior packs, resolves their native module dependencies and versions, appliespermissions.json, and starts each pack's entry under the right lifecycle. - The world seam. A narrow interface that
prismarineimplements for each level: reads by id, writes through setters, guard registration for before-events, the change log for after-events, and the inputs that carryDateandserver-netresponses. The host never imports the world's classes. - The JSP module.
@jsprismarine/server, the in-script module. Its typings are published to npm as a package of declarations only, generated from the same definitions as the runtime.
How we measure
Every measure is a count or an outcome, never a duration.
- Parity. Scenario rows in the
scripting.*families pass or fail. - Coverage. Implemented members over members, for each module and version, and the same weighted by how often the corpus uses each member. Both are reported with
reportProgressand never gate CI. - Corpus. The corpus packs that load, and the ones whose smoke scenario passes.
- Cost. Host calls, bytes copied across the C layer and steps, per callback and per tick, in unit tests with bounds such as "one host call per
getBlock".
The parity family
The families join packages/parity/src/families.ts as scripting.<domain>, starting with scripting.lifecycle, scripting.events and scripting.engine, because a family id needs a group and a domain. A scenario is a small behavior pack with a script that records what it observes, and a test that compares the record. The BDS side runs through the staging that bedrock-dump already uses to run its own script pack, and writes the record as a golden. CI compares JSP's record against the checked-in golden, and a refresh reruns BDS, as the other captures do (ADR 0019). A gap left open goes into goldens/behavior-gaps.json with its issue.
The add-on corpus
The repository never holds a copy of an add-on. A manifest in the package lists open-source add-ons with licenses that allow use, each as a repository URL and a full commit hash. Tests and the counter fetch each pack at its pinned commit into the cache on demand, as the BDS pins are fetched, and reuse the cached copy after that. The fetch checks out the exact commit, so an upstream force-push or a deleted branch cannot change what a test runs; a commit that is gone fails the fetch and names the pack. Only the manifest and the usage counts are checked in. A counter reads each pack's scripts and records which modules, classes, members and events it uses. The counts set the order of the breadth slices, and each breadth slice names the corpus packs it makes run.
Slices
- Create
packages/script-hostwith its README. - Build Bellard's QuickJS at its latest release and the C layer: handles, host dispatch, the interrupt-driven step budget, the allocation and stack limits, state per engine.
- Remove the globals BDS lacks and disable
evalandFunctionfrom a string, with ascripting.enginerow comparingglobalThiswith BDS's. - Bind it with
node:ffi, as the native networking package does. - Tests: evaluation, a host call from inside a script, a
while (true)stopped at the same step on every run, an allocation limit, two engines on two threads.
- Create
- The overrides list for metadata gaps, starting with
registerCommand's privilege. - Tests: a pack declaring 1.3.0 gets the newest 1.x, argument validation errors match the metadata, an unimplemented call names its member.
- Learned: the research note records only two of BDS's argument errors, the variant conversion failure and
ArgumentOutOfBoundsError's text. The wrong-type, argument count and no-constructor messages follow BDS's wording unconfirmed, and want ascripting.enginerow that calls members with bad arguments on BDS. Everyvalid_rangein the pinned metadata is the int32 range, whatever the type, so onlydetailsbounds an argument.
- The overrides list for metadata gaps, starting with
- manifest and native module resolution, including an undeclared
@jsprismarine/serverimport that rejects on BDS and resolves on JSP permissions.json,variables.jsonandsecrets.jsonfrom the BDS layout- version 1 and version 2 lifecycles, with the
startup,worldInitializeandworldLoadorder system.run,runTimeoutandrunInterval, and the script flush phase's order- one before-event (
chatSendcancelled) and one after-event world.sendMessage- termination when the step budget runs out, a caught stack overflow, and
watchdogTerminate /reload, andpnpm run devcalling it when a script changes- seeded
Math.random,Dateas an input, and a replay of a scripted session reaching the same digest - one QuickJS context per pack in the world's runtime, since BDS creates a context for each pack ("failed to create context" names one pack), so packs never share a
globalThis - privileges enforced from the generated shape: early execution and restricted execution throw with BDS's messages, and the load-time scan prints each pack's coverage
- a
scripting.enginerow that confirms the argument error messages slice 4 wrote in BDS's style without a capture: wrong type, wrong count, and a class with no constructor - Done when every item has a passing
scriptingrow. - Learned:
world.beforeEvents.chatSendandsystem.beforeEvents.watchdogTerminateare beta only in the pinned@minecraft/server2.10.0, and a capture has no client to chat, so the stable before-event isweatherChange, whichDimension.setWeatherraises with no player.watchdogTerminatewaits for slice 9; until thenscript-watchdog-enable-shutdownalone decides.variables.jsonandsecrets.jsonare read, but only the beta@minecraft/server-adminexposes them, so no stable row covers them. - Learned: a script's
runCommand('reload')succeeds 0 times on BDS, so thereloadscenario sends/reloadon the console and stamps ticks relative to each run. - Learned: a module's
config/<uuid>/permissions.jsonreplaces the default's list, and BDS resolves an undeclaredimport()of any module,@minecraft/server-gametestincluded, with the sameReferenceError. - Learned: a
system.runthat a running task queues waits for the next tick, while arunTimeoutof 0 queued the same way runs in the same pass, and run ids count from 1 across the whole runtime. - Learned: a Bedrock world is a JSPrismarine level, so the runtime belongs to the default level and flushes in its default world's tick, before that world's change log seals. The version 2 packs' early execution runs once the worlds have loaded, just before the version 1 packs, since no script can observe the world in early execution.
- Left: the replay trace does not record the admitted clock yet (#3226); the
script-world-messageclient-e2e scenario has not run anywhere (#3227); the milliseconds-to-steps ratio is a placeholder (#3228);chatSendandwatchdogTerminatemove to slice 9;@minecraft/server's weather andworld.sendMessageare the only world members with behavior; the script host is an optional dependency ofprismarinewhile it is private and built for Linux x64 only (#3215).
- manifest and native module resolution, including an undeclared
- Done when VS Code attaches and stops at a breakpoint in a scenario pack.
- Learned: the port is a second patch,
quickjs-debugger.patch, which adds 437 lines toquickjs.candquickjs.hand changes 5; koush's diff added 465. His 743-linequickjs-debugger.cbecamejsh_debug_*in the C layer, about 420 lines, and the protocol moved to TypeScript insrc/debugger/. The existing step tests keep their counts. The pinned QuickJS gives a frame slot only to variables a closure captures, so an evaluation borrows the slot of any other variable and leaves a closure it makes with a copy. - The world host (2026-11-17): the
script-debugger-*and*-script-debuggingproperties inconfig.json,/script debugger listen|connect|closewithdetachas an alias ofclose, auto-attach before the scripts start,DebuggerThreadfor the sockets, a handshake that waits between ticks for the extension's answer, the attach to the packtargetModuleUUIDpicks, apollafter each message, and no socket at all when the server is a replay. - Learned, from the pinned BDS 1.26.51.1's console, wire and
en_US.lang: the commands printDebugger listening on port %s,Debugger connected to host %s on port %sonce the handshake passes, andDebugger closed, the last even with nothing open. A failed connect or a refused listener printsFailed to start debugger, and the properties' refusalsInbound connections are disabledandOutbound connections are disabled. Withforce-inbound-debug-portset,/helplists/script debugger listenwith no port and a port is a syntax error. BDS has nodetach. Listening on 0 printed port 0, and 70000 printed 4464. - Learned: an attach logs
[Scripting] Debugger attached to [<ip>] on port [<port>].as a warning and sends it as aPrintEventof level 2. A refused handshake logs BDS's line as an error, sends it as a level 3PrintEventand closes, and in connect mode BDS then connects once more. The extension leaving logs[Scripting] Debugger connection closed.BDS blocks its server on the handshake: a connection that never answers stopped its ticks and its console. JSPrismarine offers the protocol and answers once the reply is there instead. - Learned: auto-attach logs
Debugger auto-attach waiting for [<n>] seconds.first, so the timeout is in seconds, thendid not connect.,did not connect, but is still listening.or afailed,line for disabled connections or a bad address. Connect mode tried for the whole timeout. An invalid connect address also logs BDS'sInvalid script debugger connect addressline. - Learned: BDS offers protocol 10, writes
require_passcode: falseout, lists every pack with a script module as a plugin, and names files from the pack'sscripts/folder: a breakpoint onmain.jsverified and one onscripts/main.jsdid not. It streamsStatEvent2every tick, sends aSchemaEventafter attaching, forwards the content log asPrintEvents, sendsThreadEventexited and new around/reload, and sends aterminatedevent beforeclosedrops the connection. BDS's listener reset every connection on this host, so its listen-mode handshake was not captured. - Learned (2026-11-20), from a capture of the pinned BDS 1.26.51.1 in connect mode with the
system-taskspack: theSchemaEventcomes right after the handshake, before the attach'sPrintEvent, and lists three tabs,Client - Timings,Client - MemoryandServer - Scripting Engine, the last a table fed by thescripting_enginestatistic.StatEvent2carries{ tick, stats }, each statistic{ name, should_aggregate, values?, children? }. Every tick sendshandle_countsandentities, about every other tick addsserver_tick_timings, and every tenth tick addsscripting_engine(QuickJS's memory usage counts),runtime_memory,app_memory,networking,chunksand the event subscriber counts. AminecraftCommandlogs[Scripting] Executing command [<command>]at info, sends it as a level 1PrintEvent, and the command's error follows the same way; asayprints nothing more./reloadsendsThreadEventexited, the pack's discovery lines at level 0, thenThreadEventnew, with no secondDebugger attachedline.script debugger closesends{ "type": "terminated" }as the last event, with noThreadEventbefore it.stopProfileranswers with aProfilerCaptureofcapture_base_path, the path the extension sent, andcapture_data, a base64.cpuprofilewith a$vscodefield, which the extension's source-map pass needs;startProfilersends nothing. - Learned: JSPrismarine sends the same schema,
entitieseach tick, and the engine's used memory asruntime_memoryandscripting_engineevery tenth tick. Its profiler samples the debugged pack's stack at each debugger poll, everypollLineslines, so it counts lines rather than time and misses a script shorter than the poll interval. A command from the command box runs between ticks, never inside a stopped or running script, as a script'sDimension.runCommandin the named dimension. The handshake that BDS refuses ends withoutterminated, since the refusal capture shows none. - Left: the VS Code check below has not run, because VS Code is not available on the host that built this. The diagnostics panel lacks BDS's other statistics and ignores
diagnostics-set-active(#3322). - Checking it with VS Code: install the Minecraft Bedrock Debugger extension (
mojang-studios.minecraft-debugger) and runpnpm --filter @jsprismarine/script-host run build:native. Give the server a flat world,"content-world-packs": ["<checkout>/packages/parity/scenarios/system-tasks/tasks"],"allow-inbound-script-debugging": true,"force-inbound-debug-port": 19144,"script-debugger-auto-attach": "listen"and"script-debugger-auto-attach-timeout": 120inconfig.json, and start it withpnpm dev. It logs that auto-attach is waiting. Open the pack's folder in VS Code, set a breakpoint onrecord('run A');inscripts/main.js, and start anattachconfiguration of typeminecraft-jswith"mode": "connect","localRoot": "${workspaceFolder}/scripts/","port": 19144and"targetModuleUuid": "13f251b3-41c9-4271-b2d1-d4abde28890b". The server logsDebugger attached, starts the scripts, and the first tick stops at the breakpoint withmain.json top of the call stack, and the server does not tick while it is stopped. Inspect a variable, continue, and runscript debugger closeon the console: VS Code's session ends and the server printsDebugger closed. For the other direction, set"mode": "listen"and runscript debugger connect localhost 19144withallow-outbound-script-debuggingon.
- Learned (2026-11-17): the corpus is 19 packs from 13 repositories, 11 of them stable on
@minecraft/serverand 8 beta. Mojang's three editor samples, its project template, a ChestLockAddon pack on2.0.0-alphaand Protection-Area-Addon, whose entry script is missing at its commit, stay out with the research note's three exclusions. The research note's samples commit73a171fc8bnames no commit; the pin is the head,73a171fc83. - Learned:
system.run,runTimeoutandrunInterval, the players and dimensions ofworld,getComponentwith the inventory's container,new ItemStack,scriptEventReceiveandstartuplead both rankings. Custom commands (CustomCommandParamType,CommandPermissionLevel) appear in 6 of the 8 beta packs, world dynamic properties in 7 of them, and@minecraft/server-uiforms in 11 packs in all.WorldBeforeEvents.chatSendandplayerPlaceBlockare beta-only and used by 5 beta packs each, which supports doing slice 9 first.packages/script-host/corpus/ranking.mdhas the full ranking.
- Learned (2026-11-17): the corpus is 19 packs from 13 repositories, 11 of them stable on
- The Beta APIs experiment as a world setting, sent to clients and required by a pack that declares a
-betaversion, with BDS's message when it is off. - The generated shape of each beta version the pinned BDS ships. Beta versions do not follow semver, so a
scripting.lifecyclerow records what BDS does with a pack that names another beta version. - From here on, breadth slices implement a member in the stable and beta shapes together.
- Learned (2026-11-17): BDS serves exactly one beta per module, the one it ships, and refuses every other beta, older or newer, with
requested invalid version, aCurrent [beta] versionline and the versions it ships. The wordbetanames the shipped one. A stable version it does not ship, such as 2.11.0, gets the same message, not the unknown-module one. Canopy and Construct (2.12.0-beta), Understudy (2.9.0-beta), UnRealm (2.7.0-beta), XBlockFire (2.8.0-beta), the beta samples (2.2.0-beta) and ChestLockAddon (1.17.0-beta) do not load on the pinned BDS; only LushWay's 2.11.0-beta does. Thebeta-versionsandbeta-experiment-offrows record it, and goldens now keep BDS's plugin errors asrefusals. - Learned: the Beta APIs experiment is
experiments.gametestinlevel.dat, and BDS accepts a stagedlevel.datthat holds only the experiments andGenerator. Without it, a beta of any module gets the Beta APIs message, which BDS checks before the version.3.0.0-alphaloads without the experiment and has no metadata, so JSPrismarine refuses it. - Learned: a GameTest simulated player's
chatraiseschatSendon BDS, so a capture can chat without a client: thechat-sendscenario runs/gametest runand ships a 3 by 3 by 3 structure of air, which BDS loads even with a structure location. JSPrismarine's row waits for@minecraft/server-gametest(#3211). - Learned: a canceled
watchdogTerminateleaves only thehang detectedorStack overflow detectedline; the unhandled-exception and shutdown lines do not follow. The event for a caught stack overflow comes after the script'scatchran. - Left: where BDS logs the unhandled exception when no script cancels
watchdogTerminate, and whether the event fires withscript-watchdog-enable-shutdownoff, are not captured; the runtime sends it only before a shutdown and logs the unhandled exception after it.ChatSendBeforeEvent.targetsandPlayer.namehave no behavior yet.
- The Beta APIs experiment as a world setting, sent to clients and required by a pack that declares a
- Batch 1 (2026-11-17):
world.getPlayersandgetAllPlayers,Dimension.getEntities,spawnEntity,getBlockandrunCommand,EntityandPlayerwith the inventory'sContainer,Block,BlockPermutation,ItemStack, the player join, spawn and leave events,world.beforeEvents.playerLeaveandsystem.afterEvents.scriptEventReceive. The corpus's share of member uses with behavior went from 19.8% to 60.4%. Thescripting.world,entities,blocksanditemsfamilies hold the scenarios;itemsmatches BDS. - Learned: with no player, BDS loads no chunk, so a scenario that reads blocks adds a ticking area and counts ticks from the tick the chunk at the origin loads. A GameTest simulated player raises
playerJoinandplayerSpawnin the same tick, after the test's own code. - Learned: BDS returns a new
Blockfor everygetBlockand the sameEntityandDimensionobjects every time, and a killed entity'sidandtypeIdstill answer while its other members throwInvalidEntityError. A value set on a property outside its bounds throwsPropertyOutOfBoundsError, not the argument error, andItemStack.amountset past the stack size holds a full stack while the constructor takes up to 255. - Learned: the server scenarios run on JSPrismarine in a headless server with a flat world, so their rows exercise the command verbs and setters scripts write through.
- Left: command errors keep Brigadier's wording rather than BDS's
Syntax error; only a player has an inventory a script reaches; JSPrismarine's palette lacksold_log_typeandstone_type;/scripteventworks only from a script; world dynamic properties wait for slice 12; theplayersrow waits for@minecraft/server-gametest(#3211); thescript-teleportclient-e2e scenario has not passed locally, where the client stayed on the loading screen of a server skipping ticks. - Batch 2 (2026-11-18):
World.getEntity,Dimension.getPlayers,Entity.getRotation,getHeadLocation,getViewDirection,isSneakingandapplyDamage,Player.getGameModeandselectedSlotIndex,Container.addItem, an inventory for any entity whoseminecraft:inventorydeclares a container,world.afterEvents.entitySpawn,entityHurtandentityDie, and/scripteventfrom the console and from a player. The corpus's share of member uses with behavior went from 68.6% to 74.2%. Theentitiesscenario now matches BDS, chest minecart included, and the newentity-members,players,entity-eventsandscript-event-consolescenarios hold the rest;entity-membersandplayersmatch. - Learned:
Container.addItemtops up matching stacks in slot order, then fills empty slots in slot order, leaves its argument alone and returns what did not fit.applyDamageinside the grace period of a stronger blow returns true and raises nothing, and a stronger one deals the difference (97 after 3). BDS sends a flush's entity events as every spawn, then every blow, then every death;kill()on a pig is aselfDestructblow of its whole health, and on an armor stand raises neither. A dying mob stays valid through its death animation. A gone entity'snameTagread throws the "set property" error, and theselectedSlotIndexbounds error names the propertyselectedSlot. - Left: a dying mob leaves JSPrismarine's script world at once, an armor stand's
kill()raises hurt and die events, and the console trims the end of a/scripteventmessage (scripting.eventsandscripting.worldgaps). The entity events ignoreEntityEventOptions. Next by corpus use:Player.onScreenDisplay,MolangVariableMap,world.beforeEvents.playerBreakBlockanditemUse,Player.playSound,System.runJob,Entity.addEffect,ItemStack.getComponentand block inventories. - Batch 3 (2026-11-18):
system.runJobandclearJob,Player.onScreenDisplaywithsetTitle,updateSubtitleandsetActionBar,Player.playSoundandDimension.playSoundwith theirSoundInstance,MolangVariableMapwithDimension.spawnParticle,Entity.addEffect,getEffect,getEffectsandremoveEffectwithEffect, theisSneakingsetter, a block's inventory component and its container, an item stack's durability component,world.beforeEventsandafterEventsforitemUseandplayerBreakBlock, andEntityEventOptionsonentityHurtandentityDie. The corpus's share of member uses with behavior went from 74.2% to 82.2%, and its share of pack members from 52.1% to 62.8%. The newsystem-jobs,entity-event-optionsandplayer-feedbackscenarios match BDS, andblock-inventoryandentity-effectsmatch but for the gaps below. - Learned: BDS runs a job from the tick after
runJob, before that tick's system tasks. Each tick, every job takes one step in the order they were queued, then each job runs to its end in the same order, so a job of 2,000 steps ended in one tick. JSPrismarine gives a tick's jobs 100 interpreter steps where BDS gives them what is left of the tick's time. - Learned: a subscriber with
EntityEventOptionsgets an entity's event only when each list it gives names the entity or its type. An empty list matches no entity, and BDS adds no namespace to a type, socowmatches nothing. - Learned:
addEffectreturns the effect the entity has afterwards, so a weaker effect returns the one already there.displayNamewrites the potency in Roman numerals from II up, as inSpeed IV. A removed player'sScreenDisplaythrowsFailed to call function 'Player'.playSoundreturns aSoundInstancewhoseidcounts up from 1. - Learned: a simulated player's
breakBlockbreaks the block in the next tick, and a break the before-event cancels tries again the tick after. Its firstuseItemraises bothitemUseevents in the same tick, and later calls return false and raise neither, even afterstopUsingItem, so the scenario uses one item and a unit test covers the canceled use. - Left: a mob's effects do not count down in a world with no player, because JSPrismarine has no
/tickingarea(#3251), and a dying pig'sgetEffectsthrows, as batch 2's dying mob does. On BDS, a stack read back from a chest throwsFailed to get property 'damage'.from its durability component, where JSPrismarine returns the damage.ScreenDisplay's HUD members,SoundInstance.stop,Effect.isValid,EffectTypes,Player.spawnParticle, item components other than durability andworld.afterEvents.playerInventoryItemChangehave no behavior yet. Next by corpus use:World.structureManagerandStructureManager,EntityEquippableComponent,EntityAttributeComponent,DimensionTypes,Container.getSlotandContainerSlot,world.beforeEvents.playerInteractWithBlockandEntity.getBlockFromViewDirection. - Batch 4 (2026-11-18):
world.structureManagerandStructure, a player'sequippablecomponent, the attribute components such ashealthandmovement,Container.getSlotandContainerSlot,Entity.hasComponent,DimensionTypes,EffectTypes,Effect.isValid,Player.spawnParticle, the GameTestTest.spawn, andworld.beforeEventsandafterEventsforplayerInteractWithBlockandplayerInteractWithEntity. The corpus's share of member uses with behavior went from 82.2% to 88.2%, and its share of pack members from 62.8% to 70.8%. The newstructuresandentity-componentsscenarios match BDS but for the gaps below. - Learned:
StructureManager.getreturns the same object for an id each time, andgetWorldStructureIdslists structures saved to memory too. An id needs a namespace, and one in use throws, so packs delete before they copy. A structure keeps air, andRotate90turns it clockwise seen from above, moving a block from x, z to depth - 1 - z, x and turning a log'spillar_axis. A structure'ssizelistszfirst. - Learned: only a player has
minecraft:equippableon BDS; a pig and a zombie have none. An armor slot refuses a stack not worn there and returns false, asBodydid an apple on a player. A health component's bounds are 0 and the maximum, while a speed's maximum is the largest 32-bit float. A zombie set to 0 health was still valid 4 ticks later. An emptyContainerSlotthrowsInvalidContainerSlotErrorfrom every member buthasItem,getItem,setItemandisValid, and an amount set past the stack size holds a full stack. - Learned: BDS refuses
EffectTypesin early execution but readsDimensionType.typeIdthere, because a property the metadata marksis_bakedchecks no privilege.EffectTypesincludesminecraft:emptyand lists the types in no fixed order. - Learned: a GameTest simulated player's
interactWithBlockandinteractWithEntityopen a chest and feed a pig on BDS but raise neither interaction event, so no capture records them and unit tests cover them. - Left: a level keeps its structures until it unloads, where BDS saves a structure saved to the world, and a structure holds no entities, so the item databases in Canopy and Understudy that store entities in structures read back nothing. A placement ignores
integrityandwaterlogged, and turns onlypillar_axisand the cardinal and facing direction states; no scenario recordsmirror. Thepack-structuresscenario compares a behavior pack's.mcstructurefiles, format 1 and 2, andgetPackStructureIdswith BDS. A mob has no default underwater speed (#3264). An interaction raises one event a click, soisFirstEventis always true.ScreenDisplay's HUD members,SoundInstance.stop,ItemEnchantableComponentand other item components, andworld.afterEvents.playerInventoryItemChangestill have no behavior. Next by corpus use:Entity.getBlockFromViewDirection,PistonActivateAfterEvent,Player.inputPermissions,Entity.isOnGroundandtriggerEvent,BlockVolume,Dimension.createExplosionandsetBlockType, andworld.afterEvents.playerPlaceBlock. - Entities and players (2026-11-19): every member of the entity and player classes that had none, 307 in all: each
Entity*Componentwith a component id,Entity.getComponents, the motion, state, box, raycast, property, event, fire, rotation,matches,tryTeleportandaddItemmembers ofEntity,EntityTypes, andPlayer's experience, spawn point, permission levels,Camera,ScreenDisplay's HUD members,InputInfo,PlayerInputPermissions,ClientSystemInfo,PlayerAimAssist, cooldowns, control scheme, chat names, sounds and music, with the aim assist registry and the feed, seat, waypoint, heal source and loot condition classes. A world reaches them throughScriptWorld.entitySystems. The level reads an entity's components from its pack's own file, before the Java overlays, and a joining client now gets BDS's camera presets and aim assist registry. The 2.12.0-beta shape went from 396 to 704 implemented members, and the corpus's share of member uses with behavior from 88.2% to 90.6%, of pack members from 70.7% to 76.6%. The newentity-valuesscenario matches BDS on all 303 observations. - Learned: a component reads its definition's JSON with BDS's defaults: a leash's hard, soft and max distances are 7, 4 and 12, a seat locks rotation at 181, and a navigation without
can_floatfloats with a float goal, or when it both swims and is amphibious. BDS readscanPathOverWaterfromcan_walk_in_lava. A healable item named without a namespace keeps its name in a file of format 1.26.60 or later and getsminecraft:in lower case in an older one; a tame item resolves a legacy name, so a cat'sfishreadsminecraft:cod. Every mob has water and lava speeds of 0.02, which closes the script side of #3264. - Learned: BDS lands
setPropertyandtriggerEventafter the tick, so a read in the same tick sees the old value, and a rider thrown off or a fire put out still shows until the tick ends.extinguishFirereturns true whether or not the entity burned.addLevelskeeps the bar's share of the next level, and a level below 0 is 0 with an empty bar. A first-person camera allows onlyLockedPlayerRelativeStrafe. A simulated player'sgetPingthrows BDS's engine error.getEntitiesFromViewDirectionskips an entity that overlaps the looker.addCategoryworks afterstartup. BDS lists a type's families and an entity's components in no fixed order, so the scenario sorts them, and it respawns a mob that spawned a baby. - Left: an NPC has no health attribute and an armor stand no movement attribute (#3289, the
entity-attributesgap). Chat name prefixes changechatDisplayNamebut not the chat line, and the name plate settings reach no client. A raycast treats every block but air and liquids as solid.World.getAimAssistbelongs to the world area's list and is registered here, so the two batches must keep one registration.Player.fogSettingsandlocatorBarreturn the world area's classes with the player's entity key as their state. - Blocks, items and containers (2026-11-19):
BlockBoundingBoxUtils,BlockVolume,ListBlockVolumeand their iterator;BlockTypes,BlockStates,ItemTypes,EnchantmentTypesandPotions; a block's neighbors, type facts, liquid answers, light,isSolid,getMapColor,getParts,canPlace,trySetPermutationand components;BlockPermutation.withState; an item stack's type facts, block lists, lock,cloneand the enchantable, food, cooldown, compostable, dyeable, potion, book and block property components; andContainer's find, move, swap and transfer members withContainerSlot's stack members. The answers about types come from new tables the BDS dump pack captures, which@jsprismarine/bedrock-data/script-catalogserves and a world hands the host as itscatalog. 2.12.0-beta went from 396 to 591 members with behavior, and the corpus's share of member uses from 88.2% to 90.3%, of pack members from 70.7% to 76.4%. The newblock-volumesanditem-membersscenarios match BDS;block-members,containersandblock-world-componentsmatch but for the gaps below. - Learned: BDS frees an item stack no variable holds, and a component read from it then throws
InvalidItemStackError, so a scenario keeps every stack in a variable.BlockBoundingBoxUtilstruncates toward zero whereBlockVolumefloors; a volume's iterator walks y, then z, then x, whilegetClosestweighs x, then y, then z and orders ties asstd::partial_sortleaves them.canAddEnchantmentadds the level asked to the level the stack has and throws past the maximum, and one that conflicts with an enchantment the stack has throwsEnchantmentLevelOutOfBoundsErrorrather than returning false.Container.moveItemoverwrites the slot it moves to, andtransferItemleaves what did not fit where it was.getDamageChanceRangethrows on every item, and a stack's weight is its type's weight times its amount. - Left: the sign, piston, jukebox and cauldron components (#3302), the redstone producer and instrument components (#3303), item containers (#3305), the crafter, entity storage, block property and custom component instance classes (#3306) and named ticks (#3307) have no behavior, nor do the
Enchant*loot functions andBannerPattern, which only loot tables and banners hand out. Light reads 15 where BDS reads 0 in a chunk only a ticking area loads (#3298),getMapColorignores the biome and the permutation (#3299), and asetCanDestroyof a block with legacy variants, such as stone, lists only the block where BDS lists every variant.EnchantmentTypes.getAlllists every enchantment, where BDS listed two in one scenario by no rule found. - Events (2026-11-19): the rest of
world.afterEventsandworld.beforeEventsthat a JSPrismarine game system can raise, through one shape: the world describes each event by its Script API class and its members' values, the host sends an after-event in the flush, runs a before-event as a guard in restricted execution and hands back what its scripts changed, and matches each subscriber's options against the event's entity, block, stacks and slots. Prismarine raises a kernel event for each (playerPlaceBlock,playerGamemodeChanged,entityRemove,explosion,redstoneActivatedand the rest), andscripting/eventsturns them into the Script API's; hotbar, inventory, cursor and sneaking changes come from comparing each player with the last flush. Block custom components getonStepOn,onEntityFallOn,onEntity,onRedstoneUpdateandonBlockStateChange. The@minecraft/server2.12.0-beta members with behavior went from 396 to 752 of 1671 (356 of the 421 event members), and the corpus's share of pack members from 70.7% to 84.8% and of member uses from 88.2% to 93.6%. Theworld-eventsscenario matches BDS. - Learned:
EffectAddBeforeEvent.effectTypeis the effect's name,Speed, not its id, and a duration the before-event sets is the oneaddEffectreturns and the after-event reads.gameRuleChangenames the rule asGameRulespells it,doDayLightCycle. The before-events ofeffectAddandentityRemovetake no options, so a second argument tosubscribethrows. A TNT that/summonprimes on a BDS with no player leaves the world after 41 ticks without exploding, so no capture records the explosion events yet. - Left: world clocks (#3290),
packSettingChange(#3292),soundCompleted(#3293), tripwires and target blocks (#3294),entityUpgrade(#3296) and the component hooksonStepOff,onNamedTick,onNeighborChangedandonBeforeDurabilityDamage(#3297) have no behavior; theworld-event-gapsrow records the first seven. A block click with an item raisesitemStartUseOnanditemStopUseOntogether, since the client reports no hold on a block, andDefinitionModifier.triggersis always empty. The events a client or a redstone circuit raises have unit tests but no BDS capture, which needs a client or a GameTest simulated player that does each action. - World and system (2026-11-19): the world's time of day, day, moon phase, spawn, difficulty, cheats, music and every game rule,
system.sendScriptEvent,waitTicksandserverSystemInfo, a dimension's block writes, searches, rays, light, biomes, spawned items and experience, explosions, fills and clones,BiomeTypes,world.tickingAreaManagerwith a new/tickingarea(#3251),world.primitiveShapesManagerandTextPrimitiveover the debug drawer (#3261), the loot table manager and every loot class, the overworld clock and its time markers, the splines,Triggerand a player'sfogSettings. They reach the level through one optionalScriptWorld.worldSystemseam. Members implemented in@minecraft/server2.12.0-beta went from 396 to 635, and the corpus's share of pack members with behavior from 70.7% to 73.3% and of member uses from 88.2% to 89.5%. Theworld-settings,ticking-areas,dimension-blocks,primitive-shapesandloot-tablesscenarios match BDS but for the intended differences. - Learned: BDS's flat world lies at y 0 to 3 while JSPrismarine's lies at y -64 to -61, so a scenario that writes blocks places its own at y 20 and up. Two captures cannot share a BDS run directory, and
capture:scripting --portgives one its own. - Learned: a block search or ray counts the block it starts in, counts a passable block such as short grass unless
includePassableBlocksis false, and counts a liquid only withincludeLiquidBlocks, water being passable too;getTopmostBlock's second argument is where its downward search starts. A ray'sfaceLocationis the fractional part of the hit point, so a block's top face reads y 0. - Learned: the overworld's clock is the world's absolute time with a pause of its own, apart from
doDayLightCycle;skipTogoes to a marker's next time andrewindToto its last. A spline reads back no control points, and a server lists no sound definitions. Ticking areas count the chunks they share once, a script's are kept apart from the command's, and a refused one throws at once rather than rejecting its promise. - Learned: a loot table's legacy item names, such as
record_13anddye, read under their current names with aux 0, an entry's nestedpoolsbecome aLootTableEntrysub-table of path'', and a condition with no class is left out. - Left: a paused clock and
doDayLightCyclefalse do not stop JSPrismarine's time (#3309); the sound instance controls (#3314), jigsaw placement (#3315), the locator bar and waypoints (#3313), the point-of-interest classes behind BDS's runtime condition (#3312), andregisterClock(#3290) have no behavior.registerCustomDimensionadds a void dimension with the Overworld's bounds that the save leaves out, since the scripts register it again each start, as thecustom-dimensionsscenario recorded. Unlike BDS, a reload adds a new dimension and drops one it no longer registers (ADR 0030). A registration BDS logs as deleted after a reload is not logged. Sky light under an overhang differs from BDS (#3311),/gamerule dofiretickdoes not parse (#3310), and thedimension-volumesrow waits onBlockVolume.
- Batch 1 (2026-11-17):
- Done (2026-11-17): the registries of
startupand version 1'sworldInitializewith BDS's errors; custom commands in the server's command tree with everyCustomCommandParamType, their permission level,cheatsRequired, an alias without the namespace and their enums inAvailableCommandsPacket; the callback in restricted execution, its result message to the sender and its failure as 0 successes. Thejsprismarine:script_componentsbehavior attaches to every block and item whose pack JSON names a custom component, as a version 2 key or inminecraft:custom_components, and forwardsonPlayerBreak,onPlayerInteract,beforeOnPlayerPlace,onTick,onRandomTick,onUse,onUseOn,onConsumeandonMineBlock.onPlaceandonBreakcome fromWorld.onBlockWritten, since a command's or a script's write runs no behavior hook.beforeOnPlayerPlaceis a newBlockHookshook, a guard of the player's placement. A block withminecraft:tickschedules its ticks when it is placed. A block a world pack defines now gets a state schema when the content builds, so its states have runtime ids and a command or script can place it. Thescripting.commandsandscripting.componentsfamilies hold the scenarios, andscript-custom-commandis the client-e2e scenario. - Learned, from the pinned BDS 1.26.51.1: a name without a namespace or in
minecraftthrowsNamespaceNameError(string must be prefixed with a namespace (eg. namespace:value).,string has invalid namespace (minecraft).); a second registration throwsCustomCommandError(Custom Command 'jsp:hello' was already registered.,Custom Command Enum ...) orBlockCustomComponentAlreadyRegisteredError; a missing enum throwsCustom Command depends on one or more unknown enums [jsp:nothing].; a registration afterstartupthrowsCustom Command registration failed outside of the ModuleStartup event.orCustomComponentInvalidRegistryError: Cannot register custom component outside of the ModuleStartup event., not the privilege error. A command name with an upper-case letter registers without an error, then BDS logs two[Commands] Register Commandlines and drops it. BDS also answers a custom command without its namespace. - Learned: a callback gets
String,Integer,FloatandBooleanas plain values, aLocationas aVector3whose whole absolute x and z name the middle of the block, a selector as an array of entities (empty when nothing matches, with no error), and a type as itsEntityType,ItemTypeorBlockType. AnEnumparameter takes a word the enum does not list. From a script'srunCommandthe origin isServer; aFailureresult or a callback that throws gives 0 successes and no error, and so does a command above the game directors' level. On the console a success message prints as information and a failure message, or a thrown error's message, as an error. - Learned:
onPlace,onTickandonBreakrun after the script that placed or removed the block, in the same tick, and/setblockandBlock.setTyperaise them. A block withminecraft:tickinterval 10 ticks 10 and 20 ticks after it was placed. A block named inminecraft:custom_componentsgetsonPlacebut noonBreak, and its component's parameters areundefined. A block whose version 2 component no script registered fails to parse, so the block does not exist; JSPrismarine resolves the content before any script runs and loads it. - Left: no engine event raises
onStepOn,onStepOff,onEntityFallOn,onEntity,onRedstoneUpdate,onBlockStateChange,onHitEntity,onCompleteUseoronBeforeDurabilityDamagefor a script's component yet; a component a permutation names runs for every state of the block; an item hook's block is read in the overworld; command parse errors keep Brigadier's wording;cheatsRequiredis recorded but JSPrismarine has no cheats setting; BDS'sParameterLimitis not checked;/setblockof the block already standing there counts one success where BDS counts none; the item and player hooks need a GameTest simulated player for a BDS row (#3211).
- Done (2026-11-17): the registries of
- Done (2026-11-17): the dynamic property members of
World,EntityandItemStack, withsetDynamicProperties;world.scoreboardwith every member ofScoreboard,ScoreboardObjective,ScoreboardIdentityandScoreboardScoreInfo, andEntity.scoreboardIdentity. The level keeps the world's properties and the scoreboard,/scoreboarduses the same store, and the save pass writes both as BDS does. Thepersistencescenario ofscripting.worldholds the values and errors, andpersistenceCompat.test.tsmoves a world from BDS to JSPrismarine and back. - Learned, from the pinned BDS 1.26.51.1's LevelDB: an entity keeps its properties in its actor record's
DynamicPropertiescompound, by pack header UUID, in the same form as the world's record. An item keeps them in itstag.DynamicProperties, by the script module UUID, not the header UUID. Only an item that does not stack holds them, even a stack of one apple throwsUnsupportedFunctionalityError. - Learned: the
scoreboardrecord is one compound ofCriteria(empty),DisplayObjectives(Name,ObjectiveName,SortOrderbyte, 1 descending),Entries(IdentityType1 player, 2 entity, 3 fake player,ScoreboardId, andPlayerId,EntityIDorFakePlayerName),LastUniqueID, andObjectives(Criteria,DisplayName,Name,ScoresofScoreandScoreboardId). BDS writes each list newest first and the slots in byte order.setObjectiveAtDisplaySlotand/scoreboard objectives setdisplayboth default to descending. - Learned:
getDynamicPropertyTotalByteCountis, per property, the id's UTF-8 bytes plus one plus 8 for a number, 1 for a boolean, 12 for a vector or a string's UTF-8 bytes plus one; this explains the 8 bytes the research note left open. The 32767 limit counts UTF-8 bytes. A vector part past the float range is stored as infinity, the set succeeds, and the get throwsInfinity value is not supported.NaN,Infinity, a bigint, an array and an object withoutx,yandzthrowNative variant type conversion failed.with no argument named,nulldeletes, and a bad value insetDynamicPropertieswrites none. - Learned: a scoreboard participant gets its id the first time it scores, from one counter; an entity's
displayNameis its id.getScoreof a name the board has never scored throwsFailed to resolve identity, and a removed objective's members throwFailed to find objective. - Left: a command's holder is still a name, so
/scoreboardscores a player or a selected entity as a fake player of that name, while a script scores its identity; a player's own dynamic properties and player identities are not saved, since the player record keeps no unmodeled tags; an item stack's properties stay on the script's stack and are dropped when it goes into an inventory; clients are not sent a script's scoreboard changes;/scoreboard objectives setdisplaydefaults to ascending, as Java does, where BDS defaults to descending; and the level's properties and scores are written through the level's setters but, like the weather, reach no change log, which has no level-wide entry yet. - Learned: JSPrismarine neither saves nor loads an actor's
CustomName, so a name tag a script sets is gone after a restart, and an entity from a BDS world loads without its name. The compatibility pack finds its armor stand by a tag instead.
- Done (2026-11-17): the dynamic property members of
- Learned (2026-11-17): a GameTest simulated player has no client, so the form captures join a headless
@jsprismarine/clientto BDS. A scenario'sclientlists its answers, and thescripting.uigoldens keep the form JSON the client received. The four scenarios,forms,form-json,form-responsesandforms-v1, match on JSPrismarine. - Learned: BDS writes form JSON with jsoncpp's old writer: keys in byte order, a newline at the end, only
",\and control characters escaped (\u001Fin upper case), and floats as%#.16gwith the trailing zeros cut to one, so 0.5 is0.50. Slider bounds and steps are 32-bit floats and defaults integers, even a version 1 slider's float default. An empty element list isnull. Version 1MessageFormDataswapsbutton1andbutton2in the JSON and readstrueas 1; version 2 readstrueas 0. - Learned: BDS checks a response's JSON type, not its range: an action form takes any integer, as a 32-bit unsigned number, or a boolean; a modal form takes a flat list of any length. A cancel reason wins over JSON, a response with neither stays open, and text that is not JSON disconnects the client. A player who leaves rejects their forms with
PlayerQuit, newest first, andcloseAllFormssendsClientboundCloseFormand settles nothing. - Done (2026-11-26): the data-driven
CustomForm,MessageBoxand fourObservable*classes of 2.1.0 and later have behavior in the script host. Builders keep their controls in call order, input controls require a client-writable observable of the right type, a changed observable notifies its subscribers, button clicks run their callbacks without closing the form, andshow()settles with the close reason or rejects withPlayerLeftErrorwhen the player leaves. - Done (2026-11-27, #3751 and #3822): those screens reach the client. The script host lays a form out as the pinned BDS does, one
custom_form_data_<n>ormessage_box_data_<n>property of theminecraftdata store, and the server sends it as a property of maps up to protocol 2225 and as a variable per value from 2259. Bound observables update one path, the client's writes run button callbacks and set client-writable observables, andshow()settles once the client reports the screen closed.@jsprismarine/clientfollows the screens and answers a server close. Thedata-driven-formsparity scenario records both ends on BDS. - Left:
ObservableString.getFilteredTextstays unimplemented, since it needs a text filtering service (#3826). The disconnect reason BDS gives for a response that is not JSON is not captured, so JSPrismarine's is its own.
- Learned (2026-11-17): a GameTest simulated player has no client, so the form captures join a headless
- Done (2026-11-17):
register,registerAsync, theRegistrationBuilderoptions,Test'ssucceed,fail,assert,runAfterDelay,runAtTickTime,idle,succeedWhen, the location conversions and the simulated player calls, and/gametest run,runset,stopallandclearall. A simulated player is aPlayerSessionwhose connection reaches no client, so the session manager, commands, chat and other clients list it. Thescripting.gametestfamily'sgametestscenario records the runner on BDS. - Learned, from the pinned BDS 1.26.51.1:
/gametesthasclearall,create,pos,run,runset,runsetuntilfail,runthese,runthisandstopall, and norunall.runsetwith no tag runssuite:default, which an untagged test is not in, and saysNo tests found for tag 'suite:default';runset jspalso ran an untagged test of classjsp.registerafter startup returns a builder and the test runs. - Learned: a test with a batch ran before the 12 tests without one, which started 4 ticks after it ended. Every structure loads before any test function runs, and the functions run in registration order. A missing structure fails the test with
Failed to spawn test structure with path 'structures/jsp/late.mcstructure'.succeedandfailend a test at once, and later members throwGameTestCompletedError(GameTest jsp:succeeds has already completed and can no longer access method: succeed, reasonDone), exceptisCompleted. A failedassertthrowsGameTestErrorwith typeAssert, which a script can catch.maxTicks(5)failed the test 5 ticks after it started withDidn't succeed or fail within 5 ticks, and itsTestthrewobject bound to prototype does not existin that tick.runAfterDelay(2)ran 2 ticks after the start,idle(3)resolved 3 ticks after it, andsucceedWhenran its callback once when called and once each tick after. A test's simulated players are gone 3 ticks after it passes.worldLocation({ x: 1, y: 2, z: 1 })of a test at(0, -60, 0)is(1, -58, 1). - Learned:
removeSimulatedPlayersendsworld.beforeEvents.playerLeaveand makes the player invalid in the call, andworld.afterEvents.playerLeavefollows in the next tick, so a player who leaves during a flush is reported in the next one. - Left:
.mcstructureblocks are placed, but their block entities and entities are not; a simulated player has no physics, so it walks and jumps on a straight line and does not fall;useItemreturns false;maxAttempts,padding,rotateTestandsetupTicksare kept and not acted on; the batch callbacks,GameTestSequence, the navigation and block-interaction members ofSimulatedPlayerand mostTestassertions throwNotImplementedError.
- Done (2026-11-17):
- Done (2026-11-18):
http.get,http.requestandhttp.cancelAll,HttpRequest,HttpHeaderandHttpResponse, andvariables,secrets,SecretStringandtransferPlayer. A request runs off the tick onnode:http, and its result is an input that the input step admits and records, as a chunk completion is; a replay admits the recorded results and never reaches the network. Thescripting.netfamily'snet-httpscenario runs against a local HTTP server and matches BDS; thescripting.adminfamily'sadmin-configscenario matches but for one gap. This covers the corpus's use of both modules:samples-howto-gallery-betas(http.request,HttpRequest,HttpHeader,HttpRequestMethod.Post,variables.get,secrets.get),chestlock(transferPlayer) andlushway, which declares both and calls neither. - Learned, from the pinned BDS 1.26.51.1: the builders and
SecretString's constructor are not early execution, thoughhttp.getis, and a constructor's privilege error saysNative constructor for [HttpRequest]. BDS's client islibhttpclient/1.0.0.0: it sendsAccept: */*, noConnection, aContent-Lengthonly with a body, and no body forGetorHead; it follows no redirect and gives response header names in lower case. A scheme other thanhttporhttpsrejects withMalformedUriErrornaming the scheme, empty when there is none; a refused connection rejects withInternalHttpRequestErrorand code 111, and a timeout withE_FAIL(-2147467259).cancelAllrejects every request in flight with a plainErrorof its reason. - Learned:
request.headersis one array per request that each read fills again with newHttpHeaders, so a pushed element stays and a list read beforeaddHeadergrows with it.variables.getcopies the value with object keys in byte order,secrets.getmakes a newSecretStringeach time, a secret that is not a string is dropped with a warning, andtransferPlayerchecks its options as a whole, a port past 65535 included. - Done (#3635):
dedicatedServer.stopServer,reloadPermissions,reloadScriptingConfig, which reads theconfig/folder again for every pack, andreloadCDNConfig, which has nothing to read. Theadmin-serverscenario records them on BDS. - Done (#3634):
opPlayer,deopPlayerandkickPlayer. A secondopPlayerthrowsPlayerAlreadyOpErrorand a seconddeopPlayerdoes nothing. A simulated player's op is not written toops.json, and a kick leaves it in the world, as on BDS. - Done (#3633):
dedicatedServer.allowList, over the server's new allow list:allowlist.jsonin BDS's format, theallow-listsetting, and a login check. - Left:
variables.nameslists the file's order, where BDS lists its hash map's (#3249); a NetherNettransferPlayersends nothing, as its packet is not captured; the replay trace does not write the recorded results to its file yet, as with the clock (#3226); these throwNotImplementedError: the level storage (#3636),asyncPlayerJoin(#3637),HttpResponse.deserializeand the request limits (#3638), the packet events (#3639) and the WebSocket client (#3640).
- Done (2026-11-18):
- Done: the module exports
jsprismarine, a frozen object with the server'sname,version,minecraftVersionandprotocolVersion, which the embedder passes toWorldScripts. One definition inpackages/script-host/src/host/jsprismarineServer.tsbuilds each pack's namespace, the typings and the member table on the guide page. Thejsp-detectscenario ofscripting.lifecycleshows the pattern. - Learned: the npm name
@jsprismarine/serveris the server package's, so the typings are@jsprismarine/script-types, which declares the module by name for a project'stypes. It was private with the script host until slice 18. BDS 1.26.51.1 rejects a static import of the module with the sameModule [@jsprismarine/server] is unrecognizedmessage asimport(), so the file that holds it does not load. Anasynccallback passed straight tosystem.runorsubscribenever ran past its firstawait, because the host called it outside its pack's context; it now runs in the pack's context. - Left: no member that acts on the world yet. A pack feature-tests a member a later version adds with
'name' in module.
- Done: the module exports
- Done (2026-11-18): the guide opens with script packs: building the script host, installing a pack and BDS's
config/folder, the Beta APIs experiment, the modules and versions served, how to read the load-time coverage lines, and what replay changes for a script. Packs without scripts and embedding follow, unchanged. The module table, the version a declared major resolves to, the steps per millisecond, the build platforms and the Beta APIs experiment id are docs facts read from@jsprismarine/script-hostandprismarine. - Left: the debugger section says only that support is in progress, until slice 7's VS Code check runs; the page tells readers to build the script host from a checkout until slice 18 publishes it.
- Done (2026-11-18): the guide opens with script packs: building the script host, installing a pack and BDS's
- Done (2026-11-19):
build:nativebuilds on macOS on Apple silicon, on Windows on x64 and on Linux on x64 and arm64 against glibc and musl, the platforms ADR 0006 lists. The package carriesnative/manifest.jsonand an install script that downloads the build for the machine from a GitHub release and checks its SHA-256, as@jsprismarine/native-networkdoes. The Native network workflow's jobs became a reusable workflow,native-library.yml, with its scripts inscripts/native/; the Script host workflow calls it, so a push to master that changes the native sources publishes their builds and opens the manifest's pull request.@jsprismarine/script-hostand@jsprismarine/script-typesare public, and the docs site lists both. - Learned: Bellard's QuickJS includes
<sys/time.h>and uses pthreads unconditionally, so it builds on Windows with MinGW-w64 and not with MSVC. The build uses MSYS2's UCRT64 GCC and links libgcc and winpthreads statically, so the DLL needs only system DLLs and the Universal C Runtime. macOS's linker takes neither a version script nor-z now;-fvisibility=hiddenwith the C layer's visiblejsh_functions keeps the exports to the interface there. - Learned: QuickJS wrote an out-of-memory error's stack after the error was freed, when the stack's string was the allocation past the memory limit. Windows's allocation sizes hit that allocation in the memory limit test, which crashed there;
quickjs-backtrace-oom.patchholds the error until its stack is set. A sweep of memory limits inScriptEngine.test.tscrashes the unpatched library on Linux too. - Left: the publish path (the release and the manifest's pull request) runs only from master, so the first builds are published when this merges. Until then the manifest is empty and every CI job builds its own library. The single executables embed the native networking library but not the script host's.
- Done (2026-11-19):
- Parked (2026-11-20): scriptc 0.4.14 compiles about half the packages once the error catalog is stubbed, and stops on 124 blocker sites in the rest, most of them features it does not support yet. The whole-server build's
SC3004is a crash in scriptc's code generator. #3323 lists the blockers and the repros.
- Parked (2026-11-20): scriptc 0.4.14 compiles about half the packages once the error catalog is stubbed, and stops on 124 blocker sites in the rest, most of them features it does not support yet. The whole-server build's
- Done (2026-11-18): the corpus uses only
@minecraft/debug-utilities, in the beta packscanopy,constructandlushway: the shape constructors,color,scale,timeLeft,DebugBox.bound, the arrow's head,DebugText.setTextanduseRotation, anddebugDrawer.addShapeandremoveShape. No pack declares@minecraft/diagnosticsor@minecraft/server-graphics. Every shape class anddebugDrawernow have behavior, anddisableWatchdogTimingWarningsdoes nothing, as the watchdog never warns about time. The drawer handsScriptWorld.drawDebugShapesthe shapes that changed at the end of each flush, and Prismarine sends them asPrimitiveShapesPackets, with every drawn shape to a player who joins. Thescripting.debugfamily'sdebug-shapesscenario matches BDS on all 81 observations. - Learned, from the pinned BDS 1.26.51.1: a float property keeps what a 32-bit float keeps (
scale = 1.1reads1.100000023841858), an integer one drops its fraction, and colors and scales outside their usual range are kept.timeLeftsetstotalTimeLefttoo. A dimension given toaddShapedoes not become the shape'sdimension. ARawMessagetext reads back insiderawtext. A shape taken out of the drawer loses one more tick's time. A shape whose time ran out keeps reading 0, and adding it again does not restart it. - Learned: BDS takes each frame's elapsed time off a drawn shape's
timeLeft, which went from 0.007 to 0.057 seconds a tick in the captures. JSPrismarine takes off 0.05 seconds a tick, so a replay counts the same, and the scenario records which way each count moved rather than its values. - Learned: BDS words a setter's conversion error with
Function return valuewhere an argument's saysFunction argument [n], for@minecraft/serversetters such asItemStack.amounttoo. A plain object where a class instance belongs isObject did not have a native handle., a float property's bounds error leaves the value out and gives the float range ([0, 340282346638528859811704183484516925440.00]), and a variant lists its types primitives first, then classes and interfaces, then arrays, each in the metadata's order. The runtime now does all four for every module. A bounds error also leaves its text on BDS's error stack, and the next conversion error's message carries it; the runtime does not copy that. - Left:
collectRuntimeStats,collectPluginStats, the diagnostics classes, all of@minecraft/diagnosticsand all of@minecraft/server-graphicsthrowNotImplementedError(#3262). The wire's sphere segments and a cylinder's pair of radii per axis are guesses no capture checks yet.@minecraft/server's ownprimitiveShapesManagerandTextPrimitive, which one stable corpus pack uses, have no behavior (#3261).
- Done (2026-11-18): the corpus uses only
Risks
- The API is large and keeps moving. Mojang ships a new
@minecraft/serverversion with most game releases. Generation makes the shape a regeneration, and behavior stays a hand-written backlog that the coverage counts make visible. - BDS behavior that the docs leave out. Event order inside a tick, error messages and edge cases are only knowable by running BDS. The parity family is the source of truth, not the docs.
- The debugger needs an engine patch. koush's patch is about 450 lines of
quickjs.cand must keep applying across QuickJS releases. Slice 7 sizes the port. - The engine differs from BDS's. Ours is a newer QuickJS. Hidden globals are tested, and parser differences such as the regular expression
vflag are recorded gaps. - A JavaScript engine is attack surface. Packs come from strangers. The pin follows releases, and the sandbox exposes nothing outside the bindings.
node:ffiis experimental. The native networking package already depends on it. A Node-API addon is the fallback ADR 0023 names.- Host calls cost an FFI crossing each. Slice 3 counts them, and bindings for reads made often are designed to batch.
- Step budgets differ from milliseconds. A script BDS lets finish may stop on JSP, or the reverse. The default ratio comes from corpus runs, and an admin can change it.
- Beta churn. Beta modules can break on any minor release, so each BDS bump can change what a beta pack sees. The regenerated shape's diff shows it, and corpus packs pinned to a beta BDS no longer ships fail their fetch-and-load row with that reason.
- Two lifecycles. Version 1 and version 2 differ in startup and promise timing, and both stay in use for years.
Open questions
- The default ratio from milliseconds to steps.
- The rest are in the research note's open questions.