Skip to content

Create a plugin from the template

The repository ships a dotnet new template in templates/ramjet-plugin/. It creates a ready-to-build class library with the right project settings, a small plugin class, a plugin.json, and an AGENTS.md for AI coding agents.

From a checkout of the repository:

Terminal window
# Windows
powershell -ExecutionPolicy Bypass -File templates/install.ps1
# Linux / macOS
sh templates/install.sh

Both run dotnet new install templates/ramjet-plugin --force, so there is nothing to pack or publish. To remove it again, pass -Uninstall / --uninstall.

If you prefer a NuGet package (to hand the template to others), pack it and install the .nupkg:

Terminal window
dotnet pack templates -c Release -o artifacts
dotnet new install artifacts/Ramjet.Templates.1.0.0.nupkg
Terminal window
dotnet new ramjet-plugin -n Homes --Author "Ahmed" --PluginDescription "Set and teleport to homes"
cd Homes
Option Default Effect
-n, --name MyPlugin assembly, namespace and plugin name; also the lower-cased id in plugin.json
--Author Your Name [PluginInfo(Author = ...)] and plugin.json
--PluginDescription A plugin for ramjet. [PluginInfo(Description = ...)] and plugin.json
--RamjetApiVersion 1.0.0-preview.1 version of the Ramjet.Api package the project references

The project references Ramjet.Api, the plugin API as a NuGet package. It holds a reference assembly: every public type and member of the API, with its documentation (IntelliSense), and no code. Your plugin compiles against it, and the server supplies the real API when it loads the plugin, so nothing from the package is copied next to your dll. You don’t need a server build to compile a plugin.

The package also sets up the project:

  • EnableDynamicLoading and implicit usings, so each plugin loads into its own unloadable context;
  • global usings for the API namespaces (Mc.Scripting, Mc.Scripting.Commands, Mc.Scripting.Events, …). Set RamjetGlobalUsings to false to turn them off;
  • the deploy step described below.

Until the package is on nuget.org, add the folder that holds Ramjet.Api.<version>.nupkg as a package source, once:

Terminal window
dotnet nuget add source /path/to/folder-with-the-nupkg -n ramjet
# from a checkout of the repository, build that folder first:
dotnet pack sdk/Ramjet.Api -o artifacts/sdk

Optional: point the build at a server’s plugins folder, and every build copies the plugin there, which triggers the server’s hot reload:

Terminal window
export RAMJET_PLUGINS=/path/to/run/plugins

PowerShell: $env:RAMJET_PLUGINS = 'C:\path\to\run\plugins', or per build: -p:RamjetPluginsDir=....

Terminal window
dotnet build -c Release
Homes -> .../bin/Release/net10.0/Homes.dll
Homes deployed to /path/to/run/plugins/Homes/

The second line appears only when RAMJET_PLUGINS (or RamjetPluginsDir) is set. Continue with the project layout to see what the template produced, or jump to build and hot reload to watch the plugin load.