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)Fields
Section titled “Fields”| Field | Required | Type | Description |
|---|---|---|---|
id | Yes | string | The plugin id. Follow the “id rules” below. It may differ from the folder name. |
name | No | string | The name shown in the Plugin Manager. If empty, id is used. |
version | Yes | string | Your plugin’s version, in x.y.z form. You can append -tag or +tag (for example 1.2.0-beta.1). |
sdk | Yes | string | The required SDK version range. Follow the “sdk range” below. |
dll | Yes | string | Path of the dll to load, relative to plugin.json. Subfolders are allowed; .. and absolute paths are not. Must end in .dll. |
entry | No | string | Full name of the entry class (Namespace.Class). If empty, the first class in the dll that implements INpEditorPlugin (ordered by full name) is used. |
description | No | string | Shown in the Plugin Manager’s description line and tooltip. |
author | No | string | The author. |
- Every field is a JSON string. A non-string value is treated as empty.
- Fields not listed above are ignored.
//comments and trailing commas are allowed.- If a field is invalid, the Plugin Manager shows Error (file) with the reason.
id rules
Section titled “id rules”| Rule | Valid | Invalid |
|---|---|---|
| Starts with a lowercase letter | road_tools | RoadTools · 1road · _road |
Lowercase letters, digits and _ only | road_tools2 | road-tools · road tools |
Segments can be separated with . | myteam.road_tools | myteam..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). - Inside the editor, the menu, mode and panel ids this plugin registers are prefixed with
ext.<id>.. - The settings file name (
plugin_settings\<id>.json) and saved shortcuts also use theid. If you change theidlater, saved settings do not carry over.
sdk range
Section titled “sdk range”| Written as | Meaning | When to use |
|---|---|---|
"^1.2" | 1.2.0 or later, below 2.0.0 | Recommended. 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.0 | When it must run only on 1.2.x |
">=1.0" | 1.0.0 or later (no upper bound) | Not recommended. Loads even on the next major. |
">1.0" | Above 1.0.0 | |
"<1.5" | Below 1.5.0 | Use together with another condition. |
"<=1.4" | 1.4.0 or earlier | |
">=1.0 <1.5" | 1.0.0 or later, below 1.5.0 | Join conditions with spaces. |
"=1.3.0" | 1.3.0 only | For testing |
- Write versions with 1 to 3 parts.
1is1.0.0;1.2is1.2.0. - A
-tagafter the version is ignored in comparisons. - If the editor’s SDK version is outside the range, the plugin becomes Version mismatch and is not loaded. The editor keeps running.
Which version to use
Section titled “Which version to use”| Features you use | sdk |
|---|---|
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 |
Per-version details are in the SDK changelog.
Within the same major version, the SDK only adds members and never renames them. That is why a
^1.0plugin also runs on an SDK 1.3 editor.
Examples
Section titled “Examples”The shortest file:
{ "id": "my_first_plugin", "version": "0.1.0", "sdk": "^1.0", "dll": "MyFirstPlugin.dll"}A file using every field:
{ // name shown in the manager window "id": "myteam.road_tools", "name": "도로 도구", "version": "1.2.0", "sdk": "^1.1", "dll": "bin/RoadTools.dll", "entry": "RoadTools.Plugin", "description": "선택 영역에 도로 깔기 · 가로등 · 단축키 Ctrl+Alt+R", "author": "도로팀",}