Skip to content

Sample: hello_tool

A sample that adds a stone brick stair tower preset to Add · id hello_tool · SDK ^1.1 · latest version 1.1.0

Its name in the manager window is 계단 탑 (예제) (stair tower, sample). It shows how to use several registration points in one plugin.

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
ItemValue
Editor0.9.0 or later
SDK1.1 or later (^1.1)
Plugin dependenciesNone
Sourcesamples/plugins/hello_tool/ in the NP Editor source (Plugin.cs · HelloTool.csproj · plugin.json)
  1. Build it.
    dotnet build samples/plugins/hello_tool/HelloTool.csproj -c Release
    The sample csproj references the SDK project inside the source tree. If you move it outside the source tree to build, change it to reference NP.Editor.Sdk.dll in the install folder, as in Quick start.
  2. Copy HelloTool.dll and plugin.json from the build output to %APPDATA%\NPEditor\plugins\hello_tool\ (Tools › Open plugin folder). Do not include NP.Editor.Sdk.dll.
  3. In Tools › Plugin Manager…, click Rescan. The first time, click Trusted — load in the warning.
  4. You are done when 계단 탑 (예제) is On.
  1. Hover the mouse over a floor block.
  2. Open Add on the main toolbar and search for 탑.
  3. Click 계단 탑 in the Preset category. A 5×5 tower appears with the cell under the mouse as its corner.
  4. Press Ctrl+Alt+H. A blue box and a 계단 탑 #1 name tag appear around the tower.
  5. A single Ctrl+Z removes the whole tower.
KindNameDescription
Quick addAdd › Preset › 계단 탑Builds a tower with ctx.Place as the smallest x · z corner. Search words: tower stair 탑 계단 나선
Panel계단 탑Height · wall block · stair wood settings, build count, and a 선택 가운데에 짓기 (build at selection center) button. Open it from the Window menu.
Commandtower [height]Builds a tower at (0, 1, 0). The height is clamped to 4–64. Result: 계단 탑 높이 12 — <cell count>칸
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) (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
높이 (height)Number 4–64Tower height. Saved immediately when changed
벽 블록 (wall block)TextBlock state string for walls and 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
선택 가운데에 짓기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 높이)
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 validated. If they are wrong, blocks without textures are placed.
  • A height changed with tower <height> is used only for that run and is not saved. The panel’s height field does not change either.
  • Tower display (Ctrl+Alt+H) draws only towers built by the plugin in this world. Boxes remain for towers removed with undo.
  • The initial values of the panel’s number and text fields are the settings at the time the plugin was enabled.
  • The quick add icon is registered with an old pictographic character (▤), which the editor replaces with the prefab icon. New plugins should use an icon name such as Icon: "prefab".
  • The panel name is also registered with a pictographic character (▤ 계단 탑), so it appears as 계단 탑 on screen.
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.02026-10-02First version: quick add 계단 탑 · settings panel · command tower