scene.json format
Overview
Section titled “Overview”scene.json is a JSON file that holds scene actors, sequences (Sequencer), and world logic rules. The editor includes it when it builds a .npbuild (Include scene in the export window), and the server plugin NPBridge (which contains the former NP Scene since 2.0) reads and runs it. During a live connection, the editor sends the same format to the server directly. The format name is np-scene, and the version is 1.
| Stage | What happens |
|---|---|
| 1. Editor | Saves actors, sequences and rules in the world file (.npworld). Coordinates are editor world coordinates. |
| 2. Export | Writes a scene.json for each .npbuild piece. Coordinates are converted to be relative to that piece’s minimum corner (origin). |
| 3. Server install | When the .npbuild is installed, rotation, mirroring and position are applied to convert to server coordinates. |
| 4. Server run | NPBridge creates the actors and runs the rules. |
Tips and tricks
Section titled “Tips and tricks”- When you write your own server-side handler, match the key names and value formats on this page exactly. Fields of types added by plugins are saved by the same rules (Adding world logic types).
- The editor adds
min_bridge: "2.0.8"to rules that use the flow control actions added in 0.10.2 (gate·stop·do_once·flip_flop·switch) or the math functionsinverse_lerp·wrap·snap. Update the server to NPBridge 2.0.8 or later before you deploy. - The
_graphfield inside rule nodes holds Logic graph node positions. You do not need to delete it when you edit the JSON by hand; the server ignores it. - The new fields of 0.11.0 (physics, weather cues, sequencer figures, lens, and so on) are known by different NPBridge versions on different servers. When you write a server handler or pick a server, first see the table “NPBridge version needed for each field” below. You can also check the feature list the server reports (
featuresin/v2/info).
Reference
Section titled “Reference”Top level
Section titled “Top level”{ "format": "np-scene", "version": 1, "origin": [120, 64, -40], "actors": [ … ], "animations": [ … ], "logic": [ … ], "variables": [ … ], "enums": [ … ], "types": [ … ]}| Key | Type | Always present | Meaning |
|---|---|---|---|
format | string | Yes | Always "np-scene" |
version | number | Yes | Always 1 |
origin | [x,y,z] | Yes | Editor coordinates of this piece’s minimum corner. Informational only. |
actors | array | Yes | Scene actors |
animations | array | Yes | Sequences (Sequencer) |
logic | array | Yes | World logic rules |
variables | array | When declarations exist | Variable declarations |
enums | array | When present | Enums |
types | array | When present | Data types |
If there are no actors, sequences or rules at all, scene.json is not included in the .npbuild.
Coordinates
Section titled “Coordinates”- Every position (
pos, path points, position keys, selected block cells) is relative toorigin. It is the editor coordinate minusorigin. - An actor belongs to a piece if the X and Z of its
posare within that piece’s range. Height is not considered. - An actor that falls into no piece produces an export warning.
rotis[yaw, pitch, roll]in degrees, the Minecraft way: yaw 0 = south (+Z), 90 = west (−X), pitch + = down.
Actors
Section titled “Actors”{"id": "trig_gate", "kind": "trigger", "name": "Front of the gate", "pos": [10, 64, 5], "rot": [0, 0, 0], "size": [6, 4, 3], "shape": "box", "tags": ["gate"], "props": {}}| Key | Type | Meaning |
|---|---|---|
id | string | Name unique within the world. Letters · digits · _ . -, 1–64 characters |
kind | string | See the table below |
name | string | Display name |
pos | [x,y,z] | Position (the meaning differs by kind — see the table below) |
rot | [yaw,pitch,roll] | Direction. Always [0,0,0] for trigger |
scale | [x,y,z] | Scale. display · text only |
size | [x,y,z] | Full size (blocks). trigger · blocker · particles only |
shape | string | box · sphere (size = diameter). trigger · particles can use sphere; blocker is always box |
tags | string array | Tags. [] if empty |
parent | string | id of the attached parent actor (only when present) |
props | object | Kind-specific properties |
Actors set to “Editor only” in the editor are not exported.
kind | Meaning of pos | Main props |
|---|---|---|
trigger | Zone center | (none) · interactable: true if it comes from an interaction component |
spawn | Feet | role (player · npc · mob · custom) · entity (for npc · mob) |
display | Model center | display (item · block) · item_model or block · visible · glow · glow_color · billboard (fixed · vertical · horizontal · center) · brightness (-1 = ambient light, 0–15) |
rig | Model center | An animated model (since 0.10.3, server NPBridge 2.0.9 or later). The editor exports display actors that point to a model with animations as this kind. rig (bone · animation definitions) · clip (the animation to play) · autoplay · speed · np_display (the original display actor’s properties — ignored by the server). Only the yaw of rot is used for rotation, and only uniform scale for size — Exporting animations and viewing in game. 0.11.0: for a figure that the Sequencer (Model anim and hold-in-hand tracks) moves, it adds props.seq (bones and held-item poses, blade trails, and effects baked at 20 Hz — played by the cutscene clock, NPBridge 2.2.0 or later · features seq_rig) and exports it with autoplay: false. An older server stops on the first frame. |
blockgroup | Pivot | A moving block group (0.11.0). palette (list of block ids) · cells (four integers each, x, y, z, p — a cell relative to the group’s minimum corner · a palette index) · pivot (pivot relative to the minimum corner) · visible. It is drawn as one block display per cell, one group holds up to 1,024 cells, and it has no collision. A custom block np: goes out as a note block state. A group with physics turned on goes out not as a blockgroup but as a rigid body of physics (shape: "blocks"). The server shows it from NPBridge 2.4.0 (table below). |
physics | Shape center | A physics body (0.11.0, NPBridge 2.1.0 or later · features physics). body (dynamic · static · sensor · the world settings world) · shape (sphere · box · cylinder · ring · the rigid block body blocks) · mass · restitution (bounciness) · friction · rolling · damping · gravity · velocity · look (item · block · none) · interact (none · hit · pickup · both) · hit_power · throw_power · respawn · range · on_enter · message · visible. Time-based fields (features physics_timed): wake_at (the sequence time in seconds to wake at) · hidden_before (hidden before waking) · spin (initial angular velocity) · impulses ([{t, at, dv}] timed impulses). size = the shape’s size — Physics |
text | Text center | text · color · background (#aarrggbb) · billboard · visible · shadow · see_through · alignment (center · left · right) · line_width |
light | That cell (floor(pos)) | level (0–15) · visible |
camera | Eye | fov. The 0.11.0 lens fields (for the editor and renders — the server reads only fov): lens_mm (lens mm, 0 = keep the field of view) · apply_fov (mm also sets the field of view) · dof (depth of field) · focus_dist (focus distance in m) · fstop · focus_target (focus target actor) · focus_point (focus point) · autofocus · blades · blade_rot · flare · flare_gain. The game field of view and depth of field go out baked into the sequence field lens (see “Sequence fields” below). |
path | First point | points ([[x,y,z], …]) · closed |
sound | Sound position | event · radius · mode (random · loop) · interval_min · interval_max · volume · pitch_min · pitch_max · time (any · day · night) · underground_only |
blocker | Box center | mode (barrier · push) · affects (players · all) · visible_in_editor |
particles | Area center | preset (fireflies · sparkles · spores · embers · snow · magic_dust · waterfall_mist) · particle (if empty, the preset’s particle) · color · density (0–1) · speed · size · time (always · night · day) · view_distance · max_per_second |
- The server ignores unknown
propsfields. - A sun actor (
sun—color·intensity·shadows·shafts·haze·size·flare·visible, light map rangebake_center·reach) is editor-only and is not written toscene.json. In the game it goes in the light map baked into the shader pack. If a rule or sequence points to a sun actor, the export shows a warning. display·text·lightwithvisible: falsestart hidden. They appear with the rule actionactor_show.barrierforblockerfills the empty cells in the box with barrier blocks.pushpushes out anything that enters, without blocks.- For
particles, the server spawns particles only around players withinview_distance, up tomax_per_secondper second.
Actors from components
Section titled “Actors from components”Actor components (trigger volume · blocking volume · interaction · sound emitter · light · text display) are exported as one scene actor row.
| Key | Value |
|---|---|
id | <actor id>.<component id> (for example door.interact) |
kind | trigger · blocker · sound · light · text |
parent | id of the owner actor (informational — for a block actor, the owner is not in actors) |
tags | The owner actor’s tags |
The server does not need to know any new kind.
Animations
Section titled “Animations”{"id": "gate_open", "name": "Gate opens", "length": 3.0, "loop": false, "tracks": [ {"actor": "npc_guard", "property": "pos", "keys": [{"t": 0, "v": [12.5, 64, 8.5], "ease": "smooth"}, {"t": 3, "v": [14.5, 64, 8.5]}]}, {"actor": "txt_welcome", "property": "visible", "keys": [{"t": 0, "v": true}]} ]}| Key | Meaning |
|---|---|
id · name | Sequence id and name |
length | Length (seconds) |
loop | Whether it loops |
tracks[].actor | Actor id |
tracks[].property | pos · rot · scale · visible · text · color |
keys[].t | Time (seconds). Ascending t |
keys[].v | Value — pos · rot · scale = [x,y,z], visible = boolean, text = string, color = "#aarrggbb" |
keys[].ease | linear (if omitted) · step · smooth. Applies from that key to the next key. |
visible·textare always stepped.- Before the first key, the first value applies; after the last key, the last value applies.
- A non-looping sequence stays at its last pose when it ends.
- If several sequences animate the same actor and property, the sequence that started later wins.
actor_show·actor_hidetake precedence overvisibletracks.
Sequencer fields
Section titled “Sequencer fields”You can add the fields below to a sequence. All are optional; older runners ignore them and play only tracks.
"cuts": [{"t": 0, "camera": "cam_a"}, {"t": 3, "camera": "cam_b", "blend": 1}, {"t": 5.5, "camera": ""}],"events": [{"t": 2, "signal": "intro_mid"}],"sounds": [{"t": 0.2, "event": "minecraft:block.bell.use", "volume": 1, "pitch": 1, "at": "crystal"}],"titles": [{"t": 0.6, "title": "The plaza crystal", "subtitle": "", "duration": 1.8, "fade_in": 0.3, "fade_out": 0.5}],"fades": [{"t": 0, "v": 1}, {"t": 0.9, "v": 0, "ease": "smooth"}],"fade_color": "#000000"| Field | Items (* required) | Meaning |
|---|---|---|
cuts | t* · camera* (camera actor, "" = player view) · blend (seconds, 0) | From that time, the view of that camera |
events | t* · signal* | Signal at that time — same as the action signal |
sounds | t* · event* · volume (1) · pitch (1) · at (actor) | Sound at that time |
titles | t* · title · subtitle · duration (2) · fade_in (0.5) · fade_out (0.5) | On-screen title at that time |
fades | t* · v* (0–1) · ease · color (this key’s cover color "#rrggbb", NPBridge 2.2.1 or later) | Screen overlay opacity. The cover color is the color of the key with the larger v in that range, and it is not blended. An older server ignores the key colors and covers with the single fade_color. |
fade_color | "#rrggbb" (default black) | Overlay color |
weather_cues | rate · levels ([[t, rain, thunder], …]) · bolts[] (t* · place · strength · thunder · column …) · time ([[t, time-of-day ticks], …] — sky time, NPBridge 2.2.1 or later) · pack | Cutscene weather cues that the editor makes from a sequence’s weather keys and lightning keys (NPBridge 2.1.0 or later · features weather_cues). Older servers ignore them (cutscene only, no rain or lightning). |
lens | {"hz": 20, "s": [ … ], "k": [ … ], "fov": [ … ]} | A table of the cut camera lens baked at 20 Hz (NPBridge 2.3.0 or later · features lens). s = focus in m, k = blur circle coefficient (0 = depth of field off), fov = vertical field of view in degrees (0 = no cut at that time). The time of sample i = i / hz. A sequence with no camera cuts does not have it. In the game the shader pack NP-Lite draws it. |
- Extra fields of
soundsentries in 0.11.0:pos([x,y,z]world place — if present it comes beforeat) ·game(false= not played in the game, for sounds such as rain and thunder that vanilla makes) — NPBridge 2.2.0 or later. The server ignoresauto(the mark of editor auto placement). - What is left out as editor-only: the original keys of the model anim (
rigclip), hold-in-hand, lens, and light tracks (a sequencer figure is baked intoprops.seqand the lens intolens), and camera roll (tilt — exported as 0 with a warning). Time stretching (hitches · slow motion) is also left out, so in the game it normally runs at normal speed.
{"id": "r_gate_enter", "name": "Enter the gate", "enabled": true, "trigger": {"type": "enter", "actor": "trig_gate"}, "filter": {"once": false, "once_per_player": true, "cooldown": 10, "permission": ""}, "conditions": [{"type": "time", "value": "day"}], "actions": [ {"type": "sound", "event": "minecraft:block.bell.use", "at": "trig_gate", "audience": "player"}, {"type": "anim_play", "anim": "gate_open"}, {"type": "wait", "seconds": 2}, {"type": "actor_show", "actor": "txt_welcome"} ]}| Key | Meaning |
|---|---|
id · name | Rule name |
enabled | If off, the rule does not run. |
trigger | One trigger node |
filter | once · once_per_player · cooldown (seconds) · permission |
conditions | Array of condition nodes — actions run only when all are true |
actions | Array of action nodes — run in order |
min_bridge | (Added by the editor) The server NPBridge version this rule needs. "2.0.8" = flow control actions · new math functions, "2.4.0" = rules with the new triggers of 0.11.0 (commands · chat · player events) and the new condition (text_match) inside a rule with an older trigger. The server handles these from NPBridge 2.4.0 (the version in the 0.11.1 installer); a 2.3.0 server skips these rules entirely. A server with NPBridge 2.0.8 or later skips the whole rule if it asks for a newer version than the server has. |
stop_unknown | (Added by the editor) List of action types at which the server must stop if it does not know them (for example ["gate"]). A server with NPBridge 2.0.8 or later stops that run when it meets an unknown action in this list and does not run the remaining actions. Unknown actions not in the list are skipped. |
A node is an object made of type and that type’s fields. The fields for each type are in the World logic type list.
- Number fields are read even when written as strings.
- The
_graphfield inside a node is editor-only (Logic graph node positions · breakpoints). The server ignores it. - For block triggers (
block_break·block_place·block_interact), ifareaisblocks,cellsis[[x,y,z], …]relative toorigin(up to 4,096 cells). Ifareais missing, it iszone.
Field values, expressions and result variables
Section titled “Field values, expressions and result variables”| Form | Meaning |
|---|---|
A field value that is exactly "{name}" | The field is bound to a variable. Right before running, the variable’s value is converted to the field kind and put in (position field = "x y z" → three numbers). If the value cannot be read, the field is treated as empty. |
{name|filter} | Type conversion ({block1|name} · {spot|y} …). A filter the server does not know is ignored and the value is used as is. |
| Expression fields | {name} · math functions · comparisons · and or not · vectors · quoted text. If there is nothing to compute, only {name} replacement and basic arithmetic are done. |
Result fields var · scope | Nodes that produce values (math · calc · *_get · *_split …) leave their results as {var} · {var.name}. The default scope of new nodes is local (only within that firing, also readable in called functions). |
| Event variables | Names that exist only when the trigger happens ({amount} · {attacker} · {block} · {block_pos} …). A declared variable with the same name wins; read the event value with {event.name}. |
The fields of functions, math, if and loops are in Variables, functions and data types and the World logic type list.
audience
Section titled “audience”Actions that choose recipients (sound · on-screen title · message · combat actions and so on) use audience.
| Value | Recipients |
|---|---|
player | The player who triggered it (default) |
inside | Everyone inside the action’s actor zone. If none, everyone inside the rule’s trigger zone |
world | Everyone in the world |
radius | Within r (16) blocks of the at actor (if empty, the triggering player) |
NPBridge version needed for each field
Section titled “NPBridge version needed for each field”The editor reads the version (bridge) and the feature list (features) that the server reports and, for live sync, leaves a field out or warns. A file export does not know the server that will receive it, so it includes the field and only warns.
| Field | Minimum version | features | Older server |
|---|---|---|---|
Flow control actions · inverse_lerp · wrap · snap | 2.0.8 | — | The rule is skipped (min_bridge). Live sync and scene deployment are blocked |
Actor rig | 2.0.9 | rig_actor | This actor is skipped |
New triggers (commands · chat · player events) · condition text_match | 2.4.0 | — | The rule is skipped (live sync shows a notice in the Server window). An older trigger + text_match blocks live sync and scene deploy |
Actor physics | 2.1.0 | physics | Kept as data only. Left out of live sync |
| Physics rigid bodies (block groups · physics turned on for an actor) | 2.1.0 | rigid | Same as above |
physics time fields (wake_at · hidden_before · spin · impulses) | 2.1.0 | physics_timed | Those values are ignored (it moves from the start and is not hidden) — a warning |
weather_cues | 2.1.0 | weather_cues | Ignored (cutscene only, no rain or lightning) |
Actor blockgroup | 2.4.0 | — | Left out of live sync. Scene deploy is blocked. A file export shows a warning |
props.seq of rig (sequencer figures) · sounds[].pos · game | 2.2.0 | seq_rig | The figure stops on the first frame. Live sync sends it without seq |
weather_cues.time (sky time) | 2.2.1 | sky_time | Ignored (the world time stays during the cutscene) |
fades[].color | 2.2.1 | fade_key_color | Covers with the single sequence fade_color |
lens | 2.3.0 | lens | Ignored (the player’s field of view stays, no depth of field) |
The server handles the
blockgroupactor and commands, chat, and the new player events (custom_command·player_chat·chat_cancel·chat_set·command_reply·text_match·sprint·craft…) from NPBridge 2.4.0 (the version in the 0.11.1 installer). A 2.3.0 or older server that receives them without a version mark handles them as in “Compatibility rules” below: an actorkindit does not know is kept as data only, a trigger rule it does not know is skipped, and a condition it does not know counts as false.
Variables · enums · data types
Section titled “Variables · enums · data types”"variables": [{"name": "score", "type": "int", "scope": "player", "default": "0"}, {"name": "hero", "type": "Hero", "scope": "player"}],"enums": [{"name": "Job", "values": ["warrior", "mage", "archer"]}],"types": [{"name": "Hero", "fields": [{"name": "hp", "type": "int", "default": "20"}, {"name": "job", "type": "Job"}]}]| Field | Keys | Meaning |
|---|---|---|
variables[] | name · type · scope · default | type = bool · int · float · string · player · actor · position · block · item · sound · particle · effect · an enum name · a data type name. scope = global · player. If default is missing, the type’s zero value |
enums[] | name · values | List of values. Initial value = default or the first value |
types[] | name · fields[] (name · type · default) | Field type = a basic type · an enum · another data type |
- All values are stored as strings. Numbers are
0.###, booleans aretrue·false, and positions are"x y z". - Data type variables can be stored under expanded names per field (
hero.hp,hero.stats.str). - Undeclared names are global string variables. They share the same store as flags (
flag·set_flag). - If the
defaultof a data type variable is an object, it gives an initial value per field (for example{"actor": "a1", "pos": "4 1 2", "block": "minecraft:gold_block"}). Missing fields use the data type’s initial value. - Values of
block·item·sound·particle·effectare id strings such asminecraft:stone(blocks may include[state]). - A custom block
np:<id>used in a block field, the initial value of ablockvariable, or the value ofset_varin the editor is converted to a note block state (minecraft:note_block[instrument=…,note=…,powered=…]) when exported. The server does not seenp:.
Actor logic (Blueprints)
Section titled “Actor logic (Blueprints)”The editor’s actor logic is stored only in .npworld; in scene.json it is expanded into rules and variables (there is no blueprints field — nothing changes on the server).
| Editor | scene.json |
|---|---|
Rule r of the actor logic attached to actor a1 | Rule id a1.r |
That logic’s variable open · {open} · Set variable open | World variable a1__open (initial value = per-actor value → the logic’s initial value) |
{self} | a1 |
Function f inside that logic | a1__f |
{@a1.open} · Set variable @a1.open elsewhere | a1__open |
Compatibility rules
Section titled “Compatibility rules”np-scene 1 is additive only. New features are added as new fields and new types; format and version do not change.
| Case | What the runner does |
|---|---|
Unknown top-level field · sequence field · props field | Ignores it. |
Unknown actor kind | Keeps it as data only (warning). |
| Unknown trigger type | Skips that rule (one warning per type). |
| Unknown condition type | Treats that condition as false (one warning). |
| Unknown action type | Skips only that action and continues with the next (one warning). If it is in the rule’s stop_unknown list, the run stops there instead (NPBridge 2.0.8 or later). |
The rule’s min_bridge is newer than the server | Skips the whole rule (NPBridge 2.0.8 or later). |
| Unknown node field | Ignores it. |
The editor does not delete unknown types or fields; it preserves them as is. Types added by other event plugins also run on servers that have those plugins.
New in 0.10.2: the flow control actions
gate·stop·do_once·flip_flop·switchand the math functionsinverse_lerp·wrap·snapneed NPBridge 2.0.8 to run. The editor does not push such logic to an older server (or a server that does not report its version) through live sync or scene deployment, and tells you why. When you export to a file, it only warns and addsmin_bridge·stop_unknown.
Related pages
Section titled “Related pages”Not an official Minecraft product. Not approved by or associated with Mojang or Microsoft.