Skip to content

creating custom modes

This article explains how to make a custom mode through JSON.

It includes both a tutorial and full documentation on JSON properties and available colours.

tutorial

The first step to creating a rainglow data pack is establishing the directory structure. Your normal data pack looks like this:

  • Directorydata
    • Directoryminecraft
      • most content found here
  • pack.mcmeta metadata for your pack
  • pack.png the icon for your pack

We’re going to be creating a new folder in data named rainglow, where rainglow related files go. Inside this folder we’ll be creating another named custom_modes, from which rainglow discovers data. All files ending with .json in this folder will be loaded.

Our structure now looks like this:

  • Directorydata
    • Directoryminecraft/ this folder is not used in our data pack, it can simply be deleted
    • Directoryrainglow
      • Directorycustom_modes
        • rainglow mode jsons go here!
  • pack.mcmeta metadata for your pack
  • pack.png the icon for your pack

Now, we get to the fun part: creating your mode! For this tutorial, our goal is to make a mode with the colours of a sunset.

In your custom_modes folder, create a new file for our custom mode. It can be called anything, as long as it’s a .json file. Our file will be named sunset.json.

sunset.json
{
"id": "sunset",
"textColour": "E07000",
"colourIds": ["red", "orange", "yellow", "pink", "purple", "indigo", "purple"]
}

To break down this file, we have three properties:

  • id: the name of your mode. This can only contain lowercase letters and underscores. Examples: lesbian_pride, monochrome, rainbow.
  • textColour: the colour of the text for your mode, in hex format. This is the colour of the text shown on the config screen. Colour pickers, such as the one built-in to Google, will be helpful.
  • colourIds: an array of colours that will be included in your mode. These are in the format of colour ids, which denote colours built into the mod. A full list of available colours can be found here.

Finally, you need to add translations for your custom mode. This has to be done through a resource pack, which is defined on the client. If you’re implementing a custom mode on your server, this will have to be sent to the client when they log in. Documentation on this can be found here.

Your resource pack should have a structure like this:

  • Directoryassets
    • Directoryrainglow
      • Directorylang
        • en_us.json an english language file
  • pack.mcmeta metadata for your pack
  • pack.png the icon for your pack

Inside your language file, you can then define your mode’s name using a key in the format "rainglow.mode.[id]". For our sunset example, the language file will look like this:

en_us.json
{
"rainglow.mode.sunset": "Sunset"
}

Now when referring to our sunset mode, its name will be shown as “Sunset”.

Finally, place your datapack and resource pack inside minecraft’s datapacks and resourcepacks folders respectively.

With that: You’re done! You have now created a custom mode, and it can be selected in game and used.