Developers Sharing a plugin

Best practices

What makes a plugin owners trust. Catalog reviewers check every one of these, and private plugins should follow them too.

Be quick

run() shares the game tick with everything else in the world. Read what you need and return. Avoid scanning large areas or every entity in a dimension; for genuinely heavy work, spread it over ticks with system.runJob and stay well inside the 12-second limit.

Expect the unexpected

Players go offline between the command and your code. Blocks and entities can be unloaded. Arguments are typed by people. Check before you use anything, and return a clear message rather than letting a raw error through.

Respect players' privacy

If your plugin reveals anything about players (where they are, what they own, when they were online), set privacy to say so plainly. Owners see it next to the switch. Keep such answers private to the person who asked, and don't collect or post more than the command needs.

Ask before changing the world

A command that changes the world (teleporting, giving items, changing game rules) should say so in its description, should be something an owner would expect, and should ask first with confirm. Plugins that surprise people won't be listed.

Stay in your lane

  • Don't make network requests or import @minecraft/server-net or @minecraft/server-admin, and don't read server secrets or variables. BedrockRelay already talks to Discord for you.
  • Don't rely on other plugins, on load order, or on globals. Keep everything in your own file.
  • Prefix anything you store, like dynamic properties, scoreboard objectives or tags, with your plugin's id, like health:last_seen.
  • Subscribe only to the events you use.
  • Leave players tagged bedrockrelay:bot out of anything you count or list. See Our bot is a player.

Don't touch the world while loading

Code at the top of your file runs while the world is still starting, when calls like world.getAllPlayers() aren't allowed. Subscribe to events there, and put anything that reads the world inside system.run().

Keep answers short

Prefer an embed with a few fields to a wall of text. Discord cuts a field at 1,024 characters, so summarise long lists: "…and 12 more".

Post sparingly

Only post by yourself for things people would be glad to see, like a milestone, and never for every small event. Declare posts so the owner decides where it goes, and postKinds if there's more than one kind.

Work everywhere you say you do

If you mark a plugin for Realms, use only the stable Script API, and try it on a Realm before you do. See Plugins on Realms.

Version carefully

Keep id and command names stable: changing them breaks people's habits and the roles owners have set up. Raise version with every change, using major.minor.patch.

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

Read the help