Skip to content

World logic

World logic is a list of rules that adds gameplay to a map. You write no code. The editor exports the rules as data (scene.json), and the server plugin NP Scene runs them as they are.

A rule runs in the following order.

OrderPartMeaningExample
1TriggerWhat starts the rule (one)On zone enter · Right-click actor · On block break · Timer
2FiltersRule limitsOnce globally · Once per player · Cooldown · Permission
3ConditionsContinue only when all are trueTime of day = night · Held item · Chance
4ActionsRun in order from the topSound · Screen title · Show actor · Wait · Teleport

When you add the Wait action (wait), the actions after it run later by the given number of seconds. If the same rule fires again while waiting, another copy runs separately.

The full list of triggers, conditions and actions and their fields is in World logic type list.

WhatWhere
World logic panelTools › World logic (the World logic tab in the bottom dock area. You can also turn it on from the Window menu)
Zone trigger wizardCtrl+Shift+T · Tools › Create zone trigger… · Zone trigger in the panel · Add › Zone trigger (wizard)
View the same rules as nodesTools › Logic graph — Logic graph

Use the zone trigger wizard to create an “on enter: sound + title” rule.

  1. Press Ctrl+Shift+T.
  2. Drag on the viewport floor to draw a zone. A plain click makes a 4×4 zone. Esc cancels drawing.
  3. Type 입구 in Name in the wizard window.
  4. Leave When set to When a player enters.
  5. Under Actions, click Play sound and Show title. Rows appear below.
  6. Check the one-line description in the Result field (for example “When a player enters “입구” → …”).
  7. Click Create. The zone actor and the rule are created together (one Ctrl+Z undoes both).
  8. To check it right away, click Create and test. Play starts.

The panel is split into the rule list on the left and the property fields on the right.

ElementWhat it does
Zone triggerStarts the zone trigger wizard (drag in the viewport for a new zone).
VariablesOpens the variables, enums and data types window — Variables, functions and data types
+Creates a new rule (zone enter → message).
Duplicate · DeleteDuplicates or deletes the selected rule.
Up · DownChanges the rule order. Rules triggered at the same moment run in list order.
Rule rowEnable icon · trigger icon · name · one-line description · error/warning icon
Fire (end of row)Appears on rules whose trigger can only be fired manually. Runs the rule in Play as if that event had happened.

Below the list are three more sections.

SectionContents
ZonesShow zones · blocking boxes in viewport · selected zone info · zone check
SimulationTime of day (atmosphere preview time · day · night) · Weather (clear · rain · thunderstorm) · Has all permissions
HistoryPlay test button and a log of fires, skips and actions (time in seconds)

When you select a zone in the viewport or the Outliner, the rules that use it are highlighted in the list and the first one opens. If no rule uses it, an Attach actions to “Name” button appears.

PartContents
HeaderEnable checkbox · trigger icon · rule name · Fire (manually fired triggers) · edit with wizard
One-line descriptionA plain description starting with →. It changes every time you edit.
idThe rule id in scene.json. Use only letters, digits, _, . and -. Press Enter to apply.
Triggertype button + fields
ConditionsList of condition cards + Add condition
ActionsList of action cards + Add action
FiltersOnce globally · Once per player · Cooldown · Permission
  • Clicking a type button opens a menu grouped by category (Zone · Flow · World · Screen · Actor · Collision · Block · Combat · Variable · Function).
  • Triggers that can only be fired manually are marked (trigger button) in the menu.
  • When you change the type, values of actor and text fields with the same name are carried over.
  • Condition and action cards have number, Up, Down, Duplicate and Delete buttons.
  • Required fields have a * after the name.
  • An actor field lists only actors of the matching type.
  • Check messages (errors and warnings) appear right below the field.
Fieldscene.jsonMeaning
Once globallyonceRuns only once on the whole server.
Once per playeronce_per_playerRuns once per player. Ignored when Once globally is on.
CooldowncooldownSeconds the same player must wait before running it again.
PermissionpermissionOnly players with this permission node run it (for example noplatea.vip).

If a condition is false, no fire record (once · cooldown) is kept.

When you drag on the floor to draw a zone, the wizard window opens. A yellow draft box appears in the viewport.

FieldChoices
NameName of the zone (or blocker box) actor
SizeCell counts for X (width) · Z (depth) · Y (height). Resizes around the center of the floor.
WhenWhen a player enters · When a player leaves · On collide (bumps into blocking box) · When a block is broken
Block to breakFor When a block is broken. Empty means any block; tags such as #minecraft:logs also work.
WhoAnyone · First person only (once per server)
LoopEvery time · Once only (per player)

Clicking an Actions button adds a row. Rows run in order from the top.

ActionAction it creates
Play soundSound
Show titleScreen title
Chat messageChat message
Show actorShow actor — choosing new text creates a hidden text actor above the zone.
Show blocksFill blocks — uses the area selected with the selection tool (4) as the range.
Play animationPlay animation
TeleportTeleport — choosing a new destination creates a spawn actor.
Open doorsTurns the door range into air and restores it after the given seconds (open/close sound selectable).
CheckpointAction bar text + checkpoint — sets the respawn location (spawn actor).
  • Create creates the zone, any needed actors and the rule at once.
  • When you edit an existing rule with the wizard, the buttons change to Save and Save and test.
  • Actions the wizard does not know are kept as-is as Other action rows. Conditions, cooldown and permission are also kept.
  • Choosing On collide creates a blocker box instead of a zone.

Since 0.9.11: The On block break, On block place and On block right-click triggers have a Where field.

WhereareaCheck
ZoneszoneBlocks inside a trigger zone actor (same as before)
Selected blockblocksOnly the block cells selected in the viewport
AnywhereanywhereThe whole world. No zone needed.

To use Selected block:

  1. Select blocks in the viewport with the selection tool.
  2. Click From selection in the Selected block field. The cells, excluding air, are added.
  3. Click the eye button to reselect and show those cells in the viewport.
  • Selected blocks are limited to 4,096 cells. For larger areas, use a zone actor.
  • Old rules without Where are read as Zones.
  • Use the Block field to filter by block type (empty means any block).

Rules are checked every time you edit them. Error and warning icons appear on list rows, and messages appear below the field in the property area.

KindExamples
ErrorMissing actor · actor of the wrong type · missing clip · wrong sound id · zone buried in blocks that cannot be entered · function rules with the same name
WarningSound library · sound not in vanilla · signal with no receiving rule · signal loop without wait · zone no rule uses · zone whose rules are all disabled · unknown type

An unknown type (a type from an event plugin this editor does not have) appears as read-only fields and is preserved as-is. It runs if the server has that plugin.

The console command logic prints the rule and clip lists and the check results as text.

  1. When you create a .npbuild in the export window, turn on Include scene (on by default). scene.json goes into the .npbuild — Export and import
  2. When the .npbuild is installed on the server, rotation, mirroring and position are applied and converted to server coordinates.
  3. The server plugin NP Scene runs the rules. No new code is generated.
  • Coordinates are exported relative to the building’s minimum corner (origin). The format is in scene.json format.
  • State such as “once” records and flags is saved by the server in state.json.
  • The Server command action runs only if an operator enables it in the server settings. The editor does not run it.
OptionLocationDefaultMeaning
Show zones · blocking boxes in viewportPanel ZonesOnTranslucent trigger zone boxes + name and one-line rule, blocker boxes (hatched)
Time of dayPanel SimulationAtmosphere preview timeThe time the Time of day condition sees in Play
WeatherPanel SimulationClearThe weather the Weather condition sees in Play
Has all permissionsPanel SimulationOnWhen off, permission filters and conditions are false in Play
Include sceneExport windowOnPuts scene.json in the .npbuild
KeyAction
Ctrl+Shift+TCreate zone trigger (drag a zone → wizard)
EscCancel zone drawing · close the wizard window
Ctrl+ZUndo rule changes (text input is merged into one step)
1–9Run a rule from the Fire list during Play
  • When you have many rules, use the Logic graph to see the flow at a glance. It is the same data, so you can edit on either side.
  • Rule edits made during Play take effect from the next Play. Play copies the rules when it starts.
  • Triggers such as On block break and On damage are not fired by Play on its own. Test them with the Fire button or the number keys.
  • The Cancel event action is meaningful only as the first action of a rule (before wait).
  • Send signal runs the rules that receive that name immediately, on the spot. If several rules receive it, all of them run.