Skip to content
NP Editor Docs
This is not the latest version — view the latest

scene.json format

scene.json is a JSON file that holds scene actors, animation clips 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.

StageWhat happens
1. EditorSaves actors, clips and rules in the world file (.npworld). Coordinates are editor world coordinates.
2. ExportWrites a scene.json for each .npbuild piece. Coordinates are converted to be relative to that piece’s minimum corner (origin).
3. Server installWhen the .npbuild is installed, rotation, mirroring and position are applied to convert to server coordinates.
4. Server runNPBridge creates the actors and runs the rules.
  • 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 of 0.10.2 (gate · stop · do_once · flip_flop · switch) or the math functions inverse_lerp · wrap · snap. Update the server to NPBridge 2.0.8 or later before you deploy.
  • The _graph field 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.
{
"format": "np-scene",
"version": 1,
"origin": [120, 64, -40],
"actors": [ … ],
"animations": [ … ],
"logic": [ … ],
"variables": [ … ],
"enums": [ … ],
"types": [ … ]
}
KeyTypeAlways presentMeaning
formatstringYesAlways "np-scene"
versionnumberYesAlways 1
origin[x,y,z]YesEditor coordinates of this piece’s minimum corner. Informational only.
actorsarrayYesScene actors
animationsarrayYesAnimation clips (Sequencer)
logicarrayYesWorld logic rules
variablesarrayWhen declarations existVariable declarations
enumsarrayWhen presentEnums
typesarrayWhen presentData types

If there are no actors, clips or rules at all, scene.json is not included in the .npbuild.

  • Every position (pos, path points, position keys, selected block cells) is relative to origin. It is the editor coordinate minus origin.
  • An actor belongs to a piece if the X and Z of its pos are within that piece’s range. Height is not considered.
  • An actor that falls into no piece produces an export warning.
  • rot is [yaw, pitch, roll] in degrees, the Minecraft way: yaw 0 = south (+Z), 90 = west (−X), pitch + = down.
{"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": {}}
KeyTypeMeaning
idstringName unique within the world. Letters · digits · _ . -, 1–64 characters
kindstringSee the table below
namestringDisplay 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
shapestringbox · sphere (size = diameter). trigger · particles can use sphere; blocker is always box
tagsstring arrayTags. [] if empty
parentstringid of the attached parent actor (only when present)
propsobjectKind-specific properties

Actors set to “Editor only” in the editor are not exported.

kindMeaning of posMain props
triggerZone center(none) · interactable: true if it comes from an interaction component
spawnFeetrole (player · npc · mob · custom) · entity (for npc · mob)
displayModel centerdisplay (item · block) · item_model or block · visible · glow · glow_color · billboard (fixed · vertical · horizontal · center) · brightness (-1 = ambient light, 0–15)
textText centertext · color · background (#aarrggbb) · billboard · visible · shadow · see_through · alignment (center · left · right) · line_width
lightThat cell (floor(pos))level (0–15) · visible
cameraEyefov
pathFirst pointpoints ([[x,y,z], …]) · closed
soundSound positionevent · radius · mode (random · loop) · interval_min · interval_max · volume · pitch_min · pitch_max · time (any · day · night) · underground_only
blockerBox centermode (barrier · push) · affects (players · all) · visible_in_editor
particlesArea centerpreset (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 props fields.
  • display · text · light with visible: false start hidden. They appear with the rule action actor_show.
  • barrier for blocker fills the empty cells in the box with barrier blocks. push pushes out anything that enters, without blocks.
  • For particles, the server spawns particles only around players within view_distance, up to max_per_second per second.

Actor components (trigger volume · blocking volume · interaction · sound emitter · light · text display) are exported as one scene actor row.

KeyValue
id<actor id>.<component id> (for example door.interact)
kindtrigger · blocker · sound · light · text
parentid of the owner actor (informational — for a block actor, the owner is not in actors)
tagsThe owner actor’s tags

The server does not need to know any new kind.

{"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}]}
]}
KeyMeaning
id · nameClip name
lengthLength (seconds)
loopWhether it loops
tracks[].actorActor id
tracks[].propertypos · rot · scale · visible · text · color
keys[].tTime (seconds). Ascending t
keys[].vValue — pos · rot · scale = [x,y,z], visible = boolean, text = string, color = "#aarrggbb"
keys[].easelinear (if omitted) · step · smooth. Applies from that key to the next key.
  • visible · text are always stepped.
  • Before the first key, the first value applies; after the last key, the last value applies.
  • A non-looping clip stays at its last pose when it ends.
  • If several clips animate the same actor and property, the clip that started later wins. actor_show · actor_hide take precedence over visible tracks.

You can add the fields below to a clip. 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"
FieldItems (* required)Meaning
cutst* · camera* (camera actor, "" = player view) · blend (seconds, 0)From that time, the view of that camera
eventst* · signal*Signal at that time — same as the action signal
soundst* · event* · volume (1) · pitch (1) · at (actor)Sound at that time
titlest* · title · subtitle · duration (2) · fade_in (0.5) · fade_out (0.5)On-screen title at that time
fadest* · v* (0–1) · easeScreen overlay opacity
fade_color"#rrggbb" (default black)Overlay color
{"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"}
]}
KeyMeaning
id · nameRule name
enabledIf off, the rule does not run.
triggerOne trigger node
filteronce · once_per_player · cooldown (seconds) · permission
conditionsArray of condition nodes — actions run only when all are true
actionsArray of action nodes — run in order
min_bridge(Added by the editor) The server NPBridge version this rule needs (for example "2.0.8" — flow control actions · new math functions). 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 _graph field inside a node is editor-only (Logic graph node positions · breakpoints). The server ignores it.
  • For block triggers (block_break · block_place · block_interact), if area is blocks, cells is [[x,y,z], …] relative to origin (up to 4,096 cells). If area is missing, it is zone.

Field values, expressions and result variables

Section titled “Field values, expressions and result variables”
FormMeaning
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 · scopeNodes 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 variablesNames 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.

Actions that choose recipients (sound · on-screen title · message · combat actions and so on) use audience.

ValueRecipients
playerThe player who triggered it (default)
insideEveryone inside the action’s actor zone. If none, everyone inside the rule’s trigger zone
worldEveryone in the world
radiusWithin r (16) blocks of the at actor (if empty, the triggering player)
"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"}]}]
FieldKeysMeaning
variables[]name · type · scope · defaulttype = 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 · valuesList 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 are true · 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 default of 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 · effect are id strings such as minecraft:stone (blocks may include [state]).

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).

Editorscene.json
Rule r of the actor logic attached to actor a1Rule id a1.r
That logic’s variable open · {open} · Set variable openWorld variable a1__open (initial value = per-actor value → the logic’s initial value)
{self}a1
Function f inside that logica1__f
{@a1.open} · Set variable @a1.open elsewherea1__open

np-scene 1 is additive only. New features are added as new fields and new types; format and version do not change.

CaseWhat the runner does
Unknown top-level field · clip field · props fieldIgnores it.
Unknown actor kindKeeps it as data only (warning).
Unknown trigger typeSkips that rule (one warning per type).
Unknown condition typeTreats that condition as false (one warning).
Unknown action typeSkips 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 serverSkips the whole rule (NPBridge 2.0.8 or later).
Unknown node fieldIgnores 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 · switch and the math functions inverse_lerp · wrap · snap need 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 adds min_bridge · stop_unknown.