Quick start
Overview
Section titled “Overview”Create a first plugin that adds one menu item and one quick add item, build it and enable it in the editor. You need a .NET SDK (8 or later) and an installed NP Editor 0.10.2. Check the prerequisites table in the Overview first.
| Kind | Name on screen | What it does |
|---|---|---|
| Menu item | Count selected blocks in the Tools menu | Shows the number of blocks inside the selection box as a notification. |
| Quick add | 3×3 pillar in the Preset category of the main toolbar Add list | Places a stone brick pillar (3×3, 6 blocks high) at the cell the mouse points at. |
Basic use
Section titled “Basic use”-
Create an empty folder
my_first_pluginand createMyFirstPlugin.csprojin it.<Project Sdk="Microsoft.NET.Sdk"><PropertyGroup><TargetFramework>net8.0</TargetFramework><EnableDynamicLoading>true</EnableDynamicLoading><Nullable>enable</Nullable><ImplicitUsings>enable</ImplicitUsings></PropertyGroup><ItemGroup><!-- SDK dll in the editor install folder. If you changed the install folder, change this path too. --><Reference Include="NP.Editor.Sdk"><HintPath>$(LOCALAPPDATA)\Programs\NP Editor\data_NPEditor_windows_x86_64\NP.Editor.Sdk.dll</HintPath><Private>false</Private></Reference></ItemGroup><ItemGroup><None Include="plugin.json" CopyToOutputDirectory="PreserveNewest" /></ItemGroup></Project> -
Create
Plugin.csin the same folder.using NP.Editor.Sdk;namespace MyFirstPlugin;public sealed class Plugin : INpEditorPlugin{public void Register(INpEditorHost host){// Tools > Count selected blocks ("도구" is the editor's key for the Tools menu — keep it in Korean)host.AddMenuItem(new NpMenuItem("count", "도구", "Count selected blocks", () =>{if (host.World.Selection is not { } box) { host.Message("No selection"); return; }int n = host.World.Blocks(box).Count();host.Message($"{n:N0} blocks in the selection");}));// Add > Preset > 3×3 pillar, placed at the cell under the mouse ("프리셋" is the key of the built-in Preset category — keep it in Korean)host.AddQuickAddItem(new NpQuickAdd("pillar", "3×3 pillar", "프리셋", ctx =>ctx.World.Edit("3×3 pillar", e => // one Edit = one undo step{for (int y = 0; y < 6; y++)for (int x = 0; x < 3; x++)for (int z = 0; z < 3; z++)e.Set(ctx.Place.X + x, ctx.Place.Y + y, ctx.Place.Z + z, "minecraft:stone_bricks");}),Keywords: "pillar column 기둥", Icon: "prefab", IconState: "minecraft:stone_bricks"));host.Log("Ready");}} -
Create
plugin.jsonin the same folder. This plugin uses only SDK 1.0 features, sosdkis^1.0.{"id": "my_first_plugin","name": "My first plugin","version": "0.1.0","sdk": "^1.0","dll": "MyFirstPlugin.dll","entry": "MyFirstPlugin.Plugin","description": "Count selected blocks + 3×3 pillar","author": "Your name"} -
Run
dotnet build -c Releasein that folder.MyFirstPlugin.dllandplugin.jsonappear inbin\Release\net8.0\. -
In the editor, click Tools > Open plugin folder. The
%APPDATA%\NPEditor\plugins\folder opens. -
Create a
my_first_pluginfolder inside it and copyMyFirstPlugin.dllandplugin.jsoninto it. Do not copyNP.Editor.Sdk.dll. -
Click Tools > Plugin Manager….
My first pluginappears in the list with the status “Approval needed”. -
Check Enable on that row.
-
The first time, the External plugins confirmation window appears. Click Trusted — load.

-
Check that the row’s status is “On” and that the Registered column shows
메뉴 1 · 빠른 추가 1.
Known issue in 0.10.2: the Registered column shows the registration summary in Korean.
메뉴 1 · 빠른 추가 1means “Menu 1 · Quick add 1”. -
Place a few blocks, select a region, then click
Count selected blocksin the Tools menu. A notification with the block count appears at the bottom of the screen. -
In the viewport, move the mouse over a floor block, click Add on the main toolbar, type
pillarin the search field and click3×3 pillar. The pillar appears at the cell the mouse last pointed at in the viewport. -
Press Ctrl+Z to undo. The whole pillar disappears at once.
Tips and tricks
Section titled “Tips and tricks”- Edit and reload: the editor does not lock the dll. Edit the code and rebuild, overwrite the dll in the same plugin folder with the new one, then select that row in the Plugin Manager and click Reload (selected). You do not need to restart the editor.
- Overwrite in the same folder: the approval is remembered by plugin
idand full folder path. If you overwrite the files in the same folder, you do not need to allow the plugin again. If you move the folder or change theid, it goes back to “Approval needed”. - Copy on every build: add a post-build copy step to the csproj and you no longer need step 6. See “Copy after build” in Testing and debugging.
- Check from the console: type
pluginsin the Console to see the list and states, orplugins reloadto see the result of rescanning the folders. - Output log: text from
host.Logappears in the Output Log panel as[my_first_plugin] Ready.
Reference
Section titled “Reference”csproj settings
Section titled “csproj settings”| Setting | Why |
|---|---|
TargetFramework = net8.0 | The .NET runtime inside the editor is 8. A dll built for a newer target (net9.0 and so on) does not load. |
EnableDynamicLoading | Lets the plugin be unloaded from memory when it is disabled, and copies NuGet dependency dlls to the output folder too. |
Private=false | Does not copy the SDK dll to the output folder. The plugin uses the editor’s SDK. |
ImplicitUsings | Adds default usings such as System.Linq and System.IO automatically. |
Copy plugin.json | plugin.json appears in the build output folder too. |
Code rules
Section titled “Code rules”- The entry class implements
INpEditorPluginand must have apublicparameterless constructor. - Attach features inside
Registerwithhost.Add…. - If
Registerthrows, nothing is registered and the plugin goes to the “Error (isolated)” state.
Related pages
Section titled “Related pages”Not an official Minecraft product. Not approved by or associated with Mojang or Microsoft.