plugin.json
Overview
Section titled “Overview”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)Basic use
Section titled “Basic use”-
Create
plugin.jsonin the plugin project folder and fill in the four fieldsid,version,sdkanddll.{"id": "my_first_plugin","version": "0.1.0","sdk": "^1.0","dll": "MyFirstPlugin.dll"} -
Add
<None Include="plugin.json" CopyToOutputDirectory="PreserveNewest" />to the csproj so the file is copied to the build output too. -
Copy the dll and
plugin.jsonfrom the build output into one folder inside the plugin folder. -
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.
Tips and tricks
Section titled “Tips and tricks”//comments and trailing commas are allowed. You can keep team notes inplugin.json.- If
entryis empty, the editor uses the first class in the dll that implementsINpEditorPlugin(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 indocs, and a Docs button appears next to the name column and in the button row at the bottom of the Plugin Manager. - Set
sdkto the lowest version of the features you actually use. See the “Which version to use” table below. - If you edit
plugin.json(even one field), you must get the signature again. Theidandversionwritten in the signature must be the same as the values inplugin.json; if they differ, the state is “Signature problem” (“Not loaded: plugin.json differs from the signed id · version (…)”) — “Getting a signature” in Distribution and versioning. - 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.
Reference
Section titled “Reference”Fields
Section titled “Fields”| Field | Required | Description |
|---|---|---|
id | Yes | The plugin id. Follow the “id rules” below. It may differ from the folder name. |
name | No | The name shown in the Plugin Manager. If empty, id is used. |
version | Yes | Your plugin’s version, in x.y.z form. You can append -tag or +tag (for example 1.2.0-beta.1). |
sdk | Yes | The required SDK version range. Follow the “sdk range” below. |
dll | Yes | Path 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. |
entry | No | Full name of the entry class (Namespace.Class; use + for a nested class). |
description | No | Appears in the detail line of the Plugin Manager and in the tooltip of the name column. |
author | No | The author. |
docs | No | URL 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.
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)” 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 theid. If you change theidlater, these do not carry over.
dll and entry rules
Section titled “dll and entry rules”| Field | Allowed | Not allowed |
|---|---|---|
dll | MyPlugin.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 to | A real file inside the plugin folder | A symbolic link or junction that points outside the plugin folder, a path whose intermediate folder is a link |
entry | MyPlugin.Plugin · MyPlugin.Outer+Inner | A name that contains an assembly name, a comma or brackets (generics) |
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. It 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, and1.2is1.2.0. - A
-tagor+tagafter the version is ignored in comparisons. - If the editor’s SDK version (0.11.1 = 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.
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 |
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.11.1, whose SDK is 1.5.0. Per-version details are in the SDK changelog.
Example with every field
Section titled “Example with every field”{ // 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",}Related pages
Section titled “Related pages”Not an official Minecraft product. Not approved by or associated with Mojang or Microsoft.