Developers Sharing a plugin

Testing

Plugins run the same on servers and Realms, but only a Bedrock Dedicated Server shows you what the pack says. Develop on one if you can, even when you're building for Realms.

A server to develop on

No dedicated server? Bedrock Dedicated Server is a free download from minecraft.net, and runs on your own Windows or Linux computer. Set it up as a world on the dashboard like any other, choosing Download the pack instead when asked for SFTP (see Setting up in the help). Then you can copy plugins in by hand, as in Your first plugin.

Seeing the pack's messages

Set content-log-console-output-enabled=true in server.properties (on some hosts it's a setting in the control panel), then restart. BedrockRelay's lines start with [BedrockRelay].

You seeIt means
plugin loaded: Health 1.0.0It loaded, and its commands will be reported.
plugin "health" was skipped: …It loaded, but its definition has a problem, such as an invalid id, a command name that isn't allowed, or a command with no run(). The reason follows.
plugin "health" failed to load: …The file is missing or threw an error while loading. Bedrock also prints its own "Unhandled promise rejection" line for it; that's expected, and the other plugins still load.
/health (health) failed: …Your run() threw. The message is shown in Discord too.

Trying a change

  • On a dedicated server, restart it to load a changed plugin.
  • On a Realm, upload the new version (with a higher version) and update it on the world. The Realm closes and opens again each time, so save Realm testing for when it already works.
  • A new command, or a changed option, reaches Discord once the world has reported it. Discord can take a moment to show it.
  • If a command doesn't appear, check the plugin is switched on on the world's Plugins tab, and that you're a Discord administrator or have a role that's allowed to use it.

Trying a script event

From a dedicated server's console (no slash), or in game as an operator on a server or a Realm:

scriptevent discord:message {"message":"Hello from the console"}

It appears in every channel with the Other addons event. See Script events.

On a Realm

There's no console on a Realm, so you see less:

  • A plugin that failed to load shows on the world's Plugins tab as Chosen, but not running. The usual reason is something from outside the stable Script API (see Stable APIs only).
  • An error your run() throws is still shown in Discord.
  • Script events and posts go by way of our bot, so they only arrive while it's in the Realm.

Try it on your own Realm as a private plugin. See Trying it on a Realm.

Running a Minecraft world rather than building for one? The help covers everything from setup to troubleshooting.

Read the help