Skip to main content

Start

Guides and information on various parts of making a plugin for WorldTool. A plugin is another data pack that can be added to the same world as WorldTool and has the ability to add and change various functionality.

Example

An example plugin can be found here. This plugin adds a General Tool operation and Brush Tool brush that places snow on top of blocks.

Getting Started

To get started, first create a new data pack with the following structure:

pack.mcmeta - Your pack.mcmeta file.
data
  namespace - Your own namespace, you can call it whatever you want.
    functions
  worldtool - WorldTool's namespace, for hook usage.
    tags
      functions
        hooks

Put your own files in your designated namespace. The worldtool namespace is only to be used for hooks.

Now create a new function and use the load hook. Inside this function, set up the appropriate plugin scores, as well as other things that you might want to set up.

In the function, first run this command:

scoreboard players add $plugins worldtool 1

Then, choose which of the following types that apply to your plugin and add them with scoreboard players add NAME worldtool 1:

  • $generalToolPlugins
  • $brushToolPlugins
  • $shapeToolPlugins
  • $settingPlugins
  • $languagePlugins
  • $greeneryPlugins
  • $blocksPerTickPlugins

It can also be a good idea to save some sort of version for your plugin.

# Example of a plugin load function

scoreboard players add $plugins worldtool 1

# This plugin would affect or add to the General Tool
scoreboard players add $generalToolPlugins worldtool 1

# Set this plugin's translations, if they haven't been set before
execute unless score #plugin.example.version worldtool matches 1 run function worldtool:language/reload
scoreboard players set #plugin.example.version worldtool 1