Skip to content
NP Editor Docs

Prefabs

A prefab is an asset that stores a block group (including props) so you can place it many times. Make anything that repeats, such as houses, streetlights and towers, into a prefab. Copies placed as links all change at once when you edit and save the original prefab. You work with prefabs in the Window > Prefabs panel, in the prefab entries of the Content Browser, and in the prefab edit window.

The example is a 5×4×5 cabin (80 blocks) with a cobblestone floor and oak plank walls and roof.

  1. With the Selection tool (Q), box-select the cabin. Drag from the top face of a roof corner to the opposite corner, and while dragging, roll Shift+wheel down three notches to include the floor (5×4×5).

    The selection box around the cabin

  2. Click Window > Prefabs. The Prefabs tab (library list · Placement options · Save selection) opens in the bottom dock area. While this panel is open, the viewport is shorter.

    The Window menu and the Prefabs panel

  3. In the Save selection group, type cabin in Name and village, house in Tags, then click Save selection. The cabin appears in the list and the status bar shows “Prefab ‘cabin’ saved (5×4×5, 80 blocks) → cabin.npprefab”.

    Name · Tags · Save selection

  1. Click the cabin in the list, then click Place below the list. Placement mode starts and the status bar shows “Placing ‘cabin’: click · [R] rotate · [F] mirror · [Esc] cancel”.

    The cabin in the list and the Place button

  2. Click the Content Browser tab in the bottom dock area to make the viewport larger again. Hover over the floor: the cabin ghost follows the mouse. The prefab’s pivot (default = bottom center) goes to the cell under the mouse.

    The Content Browser tab and the cabin ghost

  3. Click. The cabin (80 blocks) is placed as one actor (cabin_1), the tool switches to Selection and the placed cabin becomes selected. You can move it right away with W · E · R.

    The placed cabin — cabin_1 in the Outliner

  1. Go back to the Prefabs tab at the bottom and double-click the cabin in the list. The Edit prefab window (title “Edit prefab — cabin”) opens. On the left is a 3D edit viewport that holds only the prefab’s blocks (initial view = unlit); on the right are the Prefabs · Tools tabs; at the bottom are Save · Place · Animation · Duplicate as new prefab · Export to file · Close.

    The prefab edit window

  2. In the Block list of the Prefabs tab, click oak_planks ×55, type spruce_planks in the field below, and click Change. The walls in the edit viewport become spruce planks. The main world does not change until you save.

    Block list · replacement block · Change

  3. Click Save and close the window. The prefab is saved as a new revision (r2), and the cabin placed as a link (step 6) changes to spruce planks. The status bar shows “Saved ‘cabin’ r2 · updated 1 placed”. The original cabin that you only saved as a prefab at the start stays as it is. Press Esc to clear the selection from step 6 so the change is easy to see.

    The world with the linked cabin updated

New in 0.11.0: View in map in the Prefab animation window shows the animation you are editing inside the main viewport map.

  1. Click Animation in the Edit prefab window to open the Prefab animation window (see Editing animations for how to make animations). In the main viewport, set the view so that the ground where you want to show the prefab is at the center of the screen (or under the mouse).

  2. Click View in map at the bottom left of the window. The animation you are editing floats temporarily where the prefab’s anchor cell would land if you placed it, and plays in real time, and a notice states the spot and that this is a temporary preview that is not saved. If you change a key in the window, the map view changes right away.

  3. Click View in map again to remove it. Closing the window also ends it. This preview is not saved in the world.

  • While placing, R = rotate 90°. The ghost turns (0° → 90°) and is placed in that direction. F mirrors it left to right.
  • Shift+click to place several in a row. Shift+click places a copy and keeps placement mode on, so you can line up village houses one after another. When you are done, press Esc to end placement.
  • If the Prefabs panel covers the viewport, switch tabs. After you click Place, clicking the Content Browser tab keeps placement mode on, so you can place in the larger viewport.
  • To change only blocks, Change in the edit window is faster. Instead of fixing each placed copy in the world, edit and save the prefab, and every copy placed as a link changes.
MethodResult
Save selection in the Prefabs panelSaves with a name and tags (comma-separated)
Tools > Save selection as prefabSaves right away with the name “Prefab MMdd_HHmm”
Outliner right-click “Save as prop (prefab)”Saves only that actor’s blocks and props
Model import “Convert to blocks”Turns an external model into a vanilla block prefab (tag “Model conversion”) (Importing custom models)

Nothing is saved if the selection contains no blocks. Prefabs over 1 million blocks are saved in the background with a progress display.

FieldDefaultMeaning
Place as linkOnKeeps placed copies linked to the original. They update when the original is saved
Clear with empty cellsOffThe prefab’s empty cells remove existing blocks at that spot
Place props tooOnAlso places the props in the prefab
Keep edited blocksOnIn a bulk update, cells edited after placement stay as they are

Buttons below the panel list: Rescan · Place · Edit (same as double-click) · Name (F2) · Export · Import. After you edit one placed copy in the world, put the cursor over it and click Update from the one under the cursor to save the prefab in that shape as a new revision.

“Prefabs” tab fieldMeaning
Name · TagsSeparate tags with commas
Pivot (placement anchor) X · Y · Z · Bottom centerThe cell in the prefab that goes to the cursor cell when placed (2 · 0 · 2 in the example)
Bake orientation: Rotate Y 90° · Flip left/rightRotates or flips the blocks and saves (changes the default direction when placed)
BlockCount per block type. Change (to another block) · Delete (to air) the chosen block
Bottom buttonAction
SaveSaves as a new revision of the same prefab. If blocks changed, linked placed copies update too
PlaceSaves, then starts placement mode
AnimationSaves, then opens the Prefab animation window — splits the prefab into parts (bones) and creates animations that move them (Editing animations). View in map at the bottom left of the window = plays it temporarily in the main viewport map (not saved)
Duplicate as new prefabSaves as a different prefab (links stay with the original)
Export to fileTo a single .npprefab file
CloseWith unsaved changes, asks “Discard and close” · “Keep editing”

The edit viewport is separate from the main world and the main undo history. The top bar chooses the tool (Place 1 ~ Fill 7) · block to place · Main block · view (Unlit (F2) etc.). Camera controls and shortcuts are the same as in the main viewport.

  • Saving does not overwrite; it creates a new revision (r2, r3 …). The library shows only the highest revision, and older revision files stay in the folder.
  • Prefab files are saved in prefabs\ of the current project folder (the folder with the world file). Link information is saved in the world file (.npworld).
  • Import rules: a prefab not seen before = added, a higher revision of the same prefab = updated, the same or a lower revision = added as a copy.
  • One prefab can have a bounding box of up to 67,108,864 blocks (4,096 blocks per side).
ShortcutAction
R · F (while placing)Rotate · mirror
Shift+click (while placing)Place and keep placing
Esc (while placing)End placement
F2Rename (Prefabs panel)
Double-clickOpen the edit window