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

Sample: hello_tool

A sample that adds a stone brick stair tower preset to Add on the main toolbar. It has the id hello_tool, SDK ^1.1 and version 1.1.0, and appears in the Plugin Manager as 계단 탑 (예제) (stair tower, sample). It shows how to use several registration points together in one plugin. The sample’s UI text is Korean only, so this page quotes it as shown on screen, with an English gloss.

What it showsCode
Quick add + one undo stepAddQuickAddItem · World.Edit
Settings panelAddContentTab · NpUi
Console commandAddCommand
ShortcutsAddShortcut
3D overlay drawinghost.Draw
Settings storagehost.Settings
Clearing state in a new worldWorldChanged

The source is in samples/plugins/hello_tool/ in the NP Editor repository (Plugin.cs · HelloTool.csproj · plugin.json).

  1. From the repository root, run dotnet build samples/plugins/hello_tool/HelloTool.csproj -c Release. When you build inside the repository, the output goes to %LOCALAPPDATA%\NPEditorBuild\HelloTool\bin\Release\net8.0\.

  2. Copy HelloTool.dll and plugin.json from the output to %APPDATA%\NPEditor\plugins\hello_tool\ (Tools > Open plugin folder). Do not include NP.Editor.Sdk.dll.

  3. Click Tools > Plugin Manager…, then check Enable on the 계단 탑 (예제) row shown as “Approval needed”. The first time, click Trusted — load in the External plugins confirmation window.

  4. In the viewport, move the mouse over a floor block.

  5. Click Add on the main toolbar, type tower in the search field, then click 계단 탑 (stair tower) in the Preset category. A 5×5 tower appears with the cell the mouse points at as its smallest x · z corner.

  6. Press Ctrl+Alt+H to turn on the tower display. A blue box and a 계단 탑 #1 name tag appear around the tower.

    A stair tower with a translucent blue box and the "계단 탑 #1" name tag around it, and the "계단 탑" panel open in the bottom area

  7. Press Ctrl+Z to undo. The whole tower disappears at once.

  • Open the 계단 탑 panel from the Window menu to change the height · wall block · stair wood. Changed values are saved immediately and remain after you restart the editor.
  • Select a region, then click 선택 가운데에 짓기 (build at selection center) in the panel. The tower is built on the floor at the center of the selection box.
  • Press Ctrl+Alt+J to build another tower 7 cells along x from the last one. Repeat it to line the towers up in a row.
  • To change the two shortcuts, search for 계단 탑: in Tools > Shortcuts….
  • Type tower 20 in the Console to build a tower of height 20 at (0, 1, 0).
KindNameDescription
Quick addAdd > Preset > 계단 탑Builds a tower with ctx.Place as the smallest x · z corner. Search words: tower stair 탑 계단 나선. The icon is the stone brick stairs block image from IconState.
Panel계단 탑Height · wall block · stair wood settings, build count, and a 선택 가운데에 짓기 button. Open it from the Window menu.
Commandtower [높이]Builds a tower at (0, 1, 0). The height (높이) is clamped to 4–64. Result: 계단 탑 높이 12 — <cell count>칸 (stair tower height 12 — cells)
Shortcut계단 탑: 탑 표시 켜기/끄기 (toggle tower display, Ctrl+Alt+H)Draws or clears a surrounding box + name tag for each tower built in this world.
Shortcut계단 탑: 마지막 자리 옆에 또 짓기 (build another next to the last spot, Ctrl+Alt+J)Builds 7 cells along x from the last tower. If no tower has been built, at (0, 1, 0).
EventWorldChangedClears the list of built towers and the drawings on new world · open.
PartDetails
Walls5×5 perimeter, height = the Height setting, block = the 벽 블록 (wall block) setting
DoorCenter of the wall on the smallest-z side, bottom 2 cells
WindowsEvery 4 floors (y % 4 == 2), one cell at the center of each of the four walls
Center pillarCell (2, 2), wall block
StairsA spiral that circles the 8 cells around the pillar, rising one cell per level. minecraft:<stair wood>_stairs
RoofStone brick slabs + battlements, with an exit hole above the top of the stairs

One tower is one World.Edit (undo label 계단 탑 ×<height>).

RowKindWhat it does
HeightNumber 4–64Tower height. Saved immediately when changed
벽 블록 (wall block)TextBlock state string for the walls and the pillar. Saved immediately when changed
계단 나무 (stair wood)TextStair wood name (oak · spruce · birch …). Saved immediately when changed
만든 탑 … (towers built …)Live textCount built in this world · total built so far · world block count
단축키: … (shortcuts: …)Live textShortcut guide
선택 가운데에 짓기 (build at selection center)ButtonBuilds at the center of the selection box, at floor height. Only a notification if there is no selection

Stored in host.Settings. The file is %APPDATA%\NPEditor\plugin_settings\hello_tool.json.

KeyTypeDefaultDescription
heightinteger12Tower height (panel Height)
wallstringminecraft:stone_bricksWall block (panel 벽 블록)
stair_woodstringoakStair wood (panel 계단 나무)
towersinteger0Number of towers built so far (sum across all worlds)
  • The wall block and stair wood strings are not checked. A wrong name is placed as is.
  • A height changed with tower <height> is used only during this run and is not saved. The panel’s Height field does not change either.
  • The tower display draws only towers built by the plugin in this world. Boxes remain for towers removed with undo.
  • The initial values of the panel fields are the settings at the time the plugin was enabled.
  • The Icon field holds the old pictographic character ▤, but because IconState is set, the block image is used first. The pictographic character in the panel name ▤ 계단 탑 is stripped on screen, so it appears as 계단 탑. New plugins use an icon name such as Icon: "prefab".
  • If you move the sample out of the source tree to build it, change the csproj’s SDK project reference to a reference to NP.Editor.Sdk.dll in the install folder, as in Quick start.
VersionDateDetails
1.1.02026-10-02SDK 1.1: settings storage (height · wall · stair wood · build count) · shortcuts Ctrl+Alt+H / J · 3D drawing around towers
1.0.0—First version: quick add 계단 탑 · settings panel · command tower