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

plugin.json

plugin.json is the manifest file placed directly in the plugin folder. The editor uses it to find, check and load the plugin. A folder without this file is not treated as a plugin.

%APPDATA%\NPEditor\plugins\
└─ road_tools\
├─ plugin.json
├─ RoadTools.dll
└─ RoadTools.pdb (optional)
  1. Create plugin.json in the plugin project folder and fill in the four fields id, version, sdk and dll.

    {
    "id": "my_first_plugin",
    "version": "0.1.0",
    "sdk": "^1.0",
    "dll": "MyFirstPlugin.dll"
    }
  2. Add <None Include="plugin.json" CopyToOutputDirectory="PreserveNewest" /> to the csproj so the file is copied to the build output too.

  3. Copy the dll and plugin.json from the build output into one folder inside the plugin folder.

  4. Click Tools > Plugin Manager…. If a field is invalid, the row goes to the “Error (file)” state, and selecting the row shows the reason in the detail line below.

  • // comments and trailing commas are allowed. You can keep team notes in plugin.json.
  • If entry is empty, the editor uses the first class in the dll that implements INpEditorPlugin (ordered by full name). If there is only one entry class, you can leave it empty. If there are two or more, always set it.
  • Put an https:// documentation URL in docs, and a Docs button appears next to the name column and in the button row at the bottom of the Plugin Manager.
  • Set sdk to the lowest version of the features you actually use. See the “Which version to use” table below.
  • Do not connect the build output folder to the plugin folder with a link (symbolic link or junction). A link that points outside the plugin folder is “Error (file)”. Copy the dll instead.
FieldRequiredDescription
idYesThe plugin id. Follow the “id rules” below. It may differ from the folder name.
nameNoThe name shown in the Plugin Manager. If empty, id is used.
versionYesYour plugin’s version, in x.y.z form. You can append -tag or +tag (for example 1.2.0-beta.1).
sdkYesThe required SDK version range. Follow the “sdk range” below.
dllYesPath of the dll to load. It is relative to plugin.json and must end in .dll. Subfolders are allowed; anything outside the plugin folder is not. Follow the “dll and entry rules” below.
entryNoFull name of the entry class (Namespace.Class; use + for a nested class).
descriptionNoAppears in the detail line of the Plugin Manager and in the tooltip of the name column.
authorNoThe author.
docsNoURL of the plugin’s documentation (https:// only). Anything other than https is ignored, and the detail line shows the warning “docs URL must be https — ignored”.
  • Every field is a JSON string. A value that is not a string (a number such as "version": 1.0) is treated as empty.
  • Fields not listed above are ignored.
RuleValidInvalid
Starts with a lowercase letterroad_toolsRoadTools · 1road · _road
Lowercase letters, digits and _ onlyroad_tools2road-tools · road tools
Segments can be separated with .myteam.road_toolsmyteam..road · road.
  • If two plugins share the same id, only the one in the folder found first is used (plugin folder order → folder name order). The others become “Error (file)” with the reason “Id ’…’ already exists (using the earlier folder’s)”.
  • Inside the editor, the ids of the menus, modes, panels and shortcuts this plugin registers get an ext.<id>. prefix.
  • The settings file (plugin_settings\<id>.json), shortcuts the user rebound and the approval record all use the id. If you change the id later, these do not carry over.
FieldAllowedNot allowed
dllMyPlugin.dll · bin/MyPlugin.dll · bin\MyPlugin.dll.. or . segments, empty segments (bin//x.dll), absolute paths (C:\… · /… · \\server\…), drive-relative paths (C:x.dll), : · * · ? · " · < · > · | · control characters, a segment ending in a dot or space, more than 260 characters
File that dll points toA real file inside the plugin folderA symbolic link or junction that points outside the plugin folder, a path whose intermediate folder is a link
entryMyPlugin.Plugin · MyPlugin.Outer+InnerA name that contains an assembly name, a comma or brackets (generics)
Written asMeaningWhen to use
"^1.2"1.2.0 or later, below 2.0.0Recommended. Use the minimum version of the features you use.
"1.2"Same as "^1.2"
"~1.2"1.2.0 or later, below 1.3.0When it must run only on 1.2.x
">=1.0"1.0.0 or later (no upper bound)Not recommended. It loads even on the next major.
">1.0"Above 1.0.0
"<1.5"Below 1.5.0Use together with another condition.
"<=1.4"1.4.0 or earlier
">=1.0 <1.5"1.0.0 or later, below 1.5.0Join conditions with spaces.
"=1.3.0"1.3.0 onlyFor testing
  • Write versions with 1 to 3 parts. 1 is 1.0.0, and 1.2 is 1.2.0.
  • A -tag or +tag after the version is ignored in comparisons.
  • If the editor’s SDK version (0.10.2 = 1.5.0) is outside the range, the plugin becomes “Version mismatch” with the reason “Requires SDK — this editor has 1.5.0”. The editor keeps running.
Features you usesdk
Menus · quick add · commands · import/export · panels · modes · actor types · cell guards · symmetry · WorldChanged · Committed^1.0
The above + shortcuts · Settings · Draw^1.1
The above + AddSceneEvent^1.2
The above + Scene · View · field kind ActorList^1.3
The above + Account^1.4
The above + AddShowFlag · SetShowFlag · AddStatusItem · AddWorldReplaceGuard^1.5

Within the same major version, the SDK only adds members and never renames them. That is why a ^1.0 plugin also runs on 0.10.2, whose SDK is 1.5.0. Per-version details are in the SDK changelog.

{
// name shown in the manager window
"id": "myteam.road_tools",
"name": "Road tools",
"version": "1.2.0",
"sdk": "^1.1",
"dll": "bin/RoadTools.dll",
"entry": "RoadTools.Plugin",
"description": "Lay roads in the selection · street lamps · shortcut Ctrl+Alt+R",
"author": "Road team",
"docs": "https://example.com/road-tools",
}