Your first plugin
This walks a working server to a running plugin. It assumes the framework is already installed on the server; if it is not, do Server first.
You need the .NET 10 SDK on your machine to build the plugin. The server needs the .NET 10 runtime, which it already has if the framework starts.
Generate
Section titled “Generate”From a directory outside the server:
dotnet new install Hosihikari.Plugin.Templatesdotnet new hosihikari-plugin -n HelloPlugin -o HelloPluginThe result is a complete precompiled plugin project. Choose the F# template with dotnet new hosihikari-plugin-fsharp instead.
dotnet add ./HelloPlugin/HelloPlugin.csproj package Hosihikari.Plugin.Build --version 1.0.0dotnet build ./HelloPlugin/HelloPlugin.csproj -t:PackPluginPackPlugin produces HelloPlugin/dist/HelloPlugin/ — the package directory, with the manifest already filled in. A multi-target project needs -f <tfm>.
Install on the server
Section titled “Install on the server”Set Server to the server root once:
Server=/path/to/bedrock-server$Server = 'C:\bedrock-server'Copy the directory into the server:
cp -r ./HelloPlugin/dist/HelloPlugin "$Server/plugins/HelloPlugin"The directory name must equal name in the manifest. Restart the server.
Verify
Section titled “Verify”The log should show the plugin loading and enabling. Then check what it wrote:
ls "$Server/data/hosihikari/HelloPlugin"A data directory with the plugin's files means it ran.
What to read next
Section titled “What to read next”- Plugin packages — the manifest, the checks before load, the lifecycle.
- Templates — the two templates and what they generate.
- C# plugins or F# plugins — writing the plugin body.
- Troubleshooting when the plugin does not appear in the log.
Writing source instead
Section titled “Writing source instead”The templates produce a precompiled assembly. To ship .cs or .fsx source that the server compiles at load, install the matching loader package and point the manifest at the source file. See C# plugins for the layout.
