Skip to content

Configuration (EN_US)

Wudji edited this page Dec 1, 2026 · 2 revisions

Configuration files

Start Minecraft once will create these example files in the instance. Reopen the tutorial after editing a file can let the changes take place.

config/xplus_keyhint/
├── tutorial.json
├── lang/
│   ├── en_us.json
│   └── zh_cn.json
└── media/

Put your own images and GIFs in media/.

Image and GIF Size Limits

  • A static image can contain up to 4,194,304 pixels (width × height), such as 2048 × 2048.
  • A GIF canvas is subject to the same 4,194,304-pixel limit. A GIF can contain up to 600 frames, and canvas width × canvas height × frame count must not exceed 24,000,000 pixels. Every frame counts as a full canvas, even if it only updates part of the image.
GIF resolution Maximum frames
480 × 270 185
640 × 360 104
1280 × 720 26
1920 × 1080 11

The mod limits decoded pixel counts and has no separate file size limit in MB. Previews support any aspect ratio and are scaled proportionally and centered so the full image stays visible.

tutorial.json

Field Type Purpose
developerId String Minecraft player name matched without regard to case. That player sees the tutorial on every world entry. Leave it empty for the normal first-entry behavior.
defaultLanguage String Fallback language file name without .json. The default is en_us.
pages Array of page objects At least one page. The array order is the order shown in the tutorial.

Page fields

Field Type Purpose
name String Literal page title and fallback for nameKey.
nameKey String Optional key for the page title in a language file.
hints Array of hint objects Hints in display order.

Hint fields

Field Type Purpose
binding String An action ID registered by Minecraft or another Fabric mod, such as key.jump. The tutorial reads the player's current key for this action.
keys Array of strings Fixed keys for a manual hint. With binding, these are additional keys shown alongside the current binding.
name String Literal action name. For a registered action, it can replace the game's action name in the tutorial.
nameKey String Optional translation key for the action name.
description String Literal action description.
descriptionKey String Optional translation key for the action description.
preview String Optional image or GIF path. Use a file path relative to media/ or a namespaced resource ID.

For fixed key hints, ["K"], ["Ctrl", "K"], and ["Ctrl+K"] are valid forms. You can also use Minecraft key IDs, such as ["key.keyboard.left.control", "key.keyboard.k"]. A combination displays all its keys together.

Configure a tutorial

1. Add a registered action

Add a hint with binding set to the action ID. For example, key.sprint follows any changes the player makes to the sprint key in Controls. Add name and description to give the action a different name and description in the tutorial.

If you do not know the action ID, open the mod's debug page in Mod Menu, select Start Listening, and press the key in the game. Return to the debug page to read the registered action ID.

2. Describe an unregistered shortcut

Use keys for shortcuts that do not appear in Minecraft's key bindings. For example, ["Ctrl", "K"] can describe a combination key hint. Add its action name and description.

The debug page also shows physical key IDs. Click an event row to copy its key ID or combination, then paste it as a string inside the keys array.

3. Add a demonstration

Add a preview field to the hint. For a local file at config/xplus_keyhint/media/shaders.gif, use "preview": "shaders.gif". The demonstration appears when you hover over the key or its hint card.

The following resource IDs can be used directly.

Action Resource ID
Jump xplus_keyhints:media/jump.gif
Sprint xplus_keyhints:media/sprint.gif
Open Inventory xplus_keyhints:media/inventory.png
Open Chat xplus_keyhints:media/chat.gif

To add sprint and chat previews to an existing configuration, add the corresponding preview field to the hints with binding set to key.sprint and key.chat.

4. Configuration example

This example creates two pages, Movement and Other controls. It uses the player's current bindings for Sprint and Open Chat, and a fixed shortcut for Toggle Shaders (just a example).

1. Set up the pages and hints

Save the following example as config/xplus_keyhint/tutorial.json. To adapt an existing tutorial, copy the page objects you want into its pages array. The array order determines which page appears first.

{
  "developerId": "",
  "defaultLanguage": "en_us",
  "pages": [
    {
      "nameKey": "page.movement",
      "name": "Movement",
      "hints": [
        {
          "binding": "key.sprint",
          "name": "Sprint",
          "description": "Sprint while moving forward.",
          "preview": "xplus_keyhints:media/sprint.gif"
        }
      ]
    },
    {
      "name": "Other controls",
      "hints": [
        {
          "binding": "key.chat",
          "name": "Open Chat",
          "description": "Open the chat input.",
          "preview": "xplus_keyhints:media/chat.gif"
        },
        {
          "keys": ["Ctrl", "K"],
          "nameKey": "shaders.name",
          "descriptionKey": "shaders.description",
          "preview": "shaders.gif"
        }
      ]
    }
  ]
}

In this example, an empty developerId uses the normal first-entry behavior. The tutorial stops opening automatically after the player finishes or skips it.

Hint Where its keys come from Where its preview comes from
Sprint key.sprint reads the player's current Sprint binding. If they rebind it to R, reopening the tutorial highlights R. The bundled sprint.gif.
Open Chat key.chat reads the player's current Open Chat binding. The bundled chat.gif.
Toggle Shaders The keys array displays Ctrl + K. Edit the array to match the shortcut used by your shader mod. Put your recording at config/xplus_keyhint/media/shaders.gif.

2. Add the display text

Add these entries to config/xplus_keyhint/lang/en_us.json. If that file already contains translations, merge the three entries into its existing JSON object.

{
  "page.movement": "Movement",
  "shaders.name": "Toggle Shaders",
  "shaders.description": "Switch the shader effect on or off."
}

The page.movement entry supplies the first page title. The shaders.name and shaders.description entries supply the text on the shader hint. To translate them, you can create a file such as lang/fr_fr.json and use the same keys with French text. If the current language omits a key, the tutorial tries en_us from defaultLanguage, then the literal text in tutorial.json when available. A registered hint with no configured name uses the game's action name.