Developing MCreator plugins

Before you start

Before starting to create plugins for MCreator, you should know every aspect of MCreator. You should, and have to, know basic Java and (neoForge/Fabric coding with their respective concepts. Finally, success in making an MCreator plugin is possible by trying something, understanding why it doesn't work, and searching.

What you can make

With MCreator plugins, one can add new features to MCreator, more specifically (at the time of writing):

  • Custom Blockly blocks (procedures, AI tasks, command arguments, feature blocks and advancement (json) triggers)
  • Custom Blockly behaviours (JavaScript files for Blockly)
  • New data lists/mappings
  • Custom global triggers
  • New generators
  • New variable types
  • New UI themes
  • New languages
  • New templates (textures, built-in entity animations)

 

Additionally, Java plugins also have access to more systems allowing them to add:

  • New mod elements
  • New preference entries
  • New vertical workspace tabs (e.g. Workspace, Resources, Localizations, VCS, etc.)
  • New buttons on the menu bar
  • Use built-in events
  • New custom plugin systems

Demo plugins

You can start off with making a plugin by exploring demo plugins that help you get started with your own plugin:

Plugin basics

Setting up the plugin

A normal plugin will look like the following picture (from the Fabric Generator):

However, to get a working plugin, you only need a single file called plugin.json. This file is at the root of the plugin and tells MCreator this ZIP file is a plugin and what are the infos of the plugin. Let's take a look at it:

Parameters Explanations Is required?
id A unique String that's used by MCreator to recognize each plugin. Yes
supportedversions A list of the supported versions of MCreator. Each version needs to be a specific version (e.g. 202300451120). Yes
weight This number indicates the priority of the plugin over the other ones. The priority is used when you want to override another plugin's file. However, a good practice is to set the number as low as possible. You should NOT use a stupidly high number. The minimal and default value is 0 and the maximal used by a built-in plugin is 10 (mcreator-core). No, but recommended.
javaplugin This is the path pointing to your Java plugin's main class (the one extending JavaPlugin). (e.g. net.mcreator.demojavaplugin.DemoJavaPlugin). This parameter also makes your plugin a Java plugin, so users will have to enable the "Enable Java plugins" preference entry to use your plugin. Java plugins only
info/name The name displayed inside the Manage Plugins tab of the Preferences Yes
info/description What your plugin do No
info/version Your plugin's version. This version is also used by the plugin update check system (see updateJSONURL). No
info/author Your name or the name of people that worked on this plugin. No
info/credits If you want to thank someone, a group of people or something else, this is the place. No
info/updateJSONURL This is an online URL that points to a JSON file with a specific structure (see this file). Once you made an update to your plugin and you have updated the file, if the user has the preference entry enabled, MCreator will detect the new version (if the user's version and the online's version are different, then it's a new update) and warn the user with a notification on start-up. You can also add the version's changelog by using the appropriate parameters. No
info/pluginPageID If you use the info/updateJSONURL parameter, you are also able to allow the user to directly open your plugin's page by providing the node number of your plugin page. The node number is the number inside the URL.(e.g https://mcreator.net/plugin/64512/mcreator-fabric-generator) No

Example

The following plugin.json is an example of a normal MCreator plugin from the File Manager plugin.

{
  "id": "file-manager",
  "supportedversions": [202400115713],
  "info": {
    "name": "File Manager",
    "description": "Create and read your files",
    "author": "Goldorion",
    "version": "5.9",
    "updateJSONURL": "https://raw.githubusercontent.com/Goldorion/File-Manager-MCreator/master/update.json",
    "pluginPageID": 64638
  }
}

Exporting

To export the plugin, simply archive the root folder of the plugin into a ZIP file, so the plugin has the following structure:

  • <plugin file name>.zip
    • plugin.json
    • (procedures)
    • (<generator 1 name>)
    • ...

MCreator's Javadoc

MCreator's Javadoc found on https://mcreator.github.io/MCreator/ can help with plugin development too.

Video tutorial

If you prefer to watch the video, you can find the wiki page above summarized in a video:



Donate to MCreator

By donating to developers you can speed up development, as with more resources, we can dedicate more time to MCreator. It is a free project made by developers working on it in their free time.