mtr:adding_custom_resources
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| mtr:adding_custom_resources [2023/02/23 07:54] – Zbx1425 | mtr:adding_custom_resources [2025/11/21 17:20] (current) – Grammar correction Navi | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | < | + | ====== |
| - | + | ||
| - | # Adding Custom Resources | + | |
| User-created content can be added to the Minecraft Transit Railway mod via resource packs. Currently, players can add the following: | User-created content can be added to the Minecraft Transit Railway mod via resource packs. Currently, players can add the following: | ||
| - | * Texture variants for existing [trains](https:// | + | |
| - | * New textures or text for [railway signs](https:// | + | * Blockbench models |
| + | * New textures | ||
| - | It is highly recommended to be familiar with [creating a resource pack](https:// | + | It is highly recommended to be familiar with creating a resource pack before proceeding with this guide. |
| - | # Resource Pack Format | + | ===== Resource Pack structure ===== |
| - | The file `mtr_custom_resources.json` is the main file that will get loaded. This file defines custom content for the mod to register. It must be placed under the `mtr` namespace; in other words, it must have the file path of `assets/ | + | This guide will tell you how to set up your file structure |
| - | ## Adding Texture Variants for Existing Trains | + | Requirements: |
| - | To add texture variants, the `custom_trains` JSON object should be added to `mtr_custom_resouces.json`. Each JSON object under `custom_trains`, | + | ===== Guide ===== |
| - | | Key | Data Type | Description | Notes | | + | ==== Folder structure ==== |
| - | | --- | --- | --- | --- | | + | |
| - | | `name` | String | The name to be shown on [dashboards](https:// | + | |
| - | | `color` | String (colour hex code) | The colour to be shown on [dashboards](https:// | + | |
| - | | `base_train_type` | String (train ID) | The train model to apply the texture on | Required, see [the trains page](https:// | + | |
| - | | `texture_id` | String (texture ID) | The [namespaced ID](https:// | + | |
| - | An example | + | - Go to your // |
| + | - Then find the // | ||
| + | - Create a folder with a name that you want (for example: My custom M-Train) {{: | ||
| + | - Create a new folder inside of the existing folder called '' | ||
| + | - Upload a pack.png to your folder, this image will show in the resource pack selection screen and should be 128x128. | ||
| + | - Download this template pack.mcmeta and put it into your resource pack folder: | ||
| - | ``` | + | <code json pack.mcmeta> |
| { | { | ||
| - | | + | |
| - | "my_custom_train": | + | "description": "put your pack description here", |
| - | | + | "pack_format": |
| - | "color": | + | |
| - | " | + | |
| - | " | + | |
| } | } | ||
| - | } | ||
| } | } | ||
| - | ``` | + | </ |
| - | ## Adding New Railway Sign Textures or Text | + | <WRAP center round info 90%> |
| - | To add new [railway signs](https:// | + | The pack format is what version of Minecraft |
| - | | Key | Data Type | Description | Notes | | + | </WRAP> |
| - | | --- | --- | --- | --- | | + | |
| - | | `texture_id` | String (texture ID) | The [namespaced ID](https:// | + | |
| - | | `flip_texture` | Boolean | If `true`, the texture will be flipped horizontally | Optional | | + | |
| - | | `custom_text` | String | If set, the text will be shown to the right of the image; the pipe character `\|` is supported, for example `客務中心\|Customer Service Centre` | Optional | | + | |
| - | | `flip_custom_text` | Boolean | If `custom_text` is set and `flip_custom_text` is `true`, the text will be shown to the left of the image | Optional | | + | |
| - | | `small` | Boolean | If `true`, the image will be rendered with a margin around it | Optional | | + | |
| - | | `background_color` | String (colour hex code) | The colour for the backgound | Optional, defaults to the colour black if none specified | | + | |
| - | An example is shown below. | + | * Create a new folder named MTR in the assets folder. |
| + | * Create a text file inside the folder named '' | ||
| - | ``` | + | ==== JSON files ==== |
| + | |||
| + | The main code for all custom resources is here: | ||
| + | |||
| + | <code json mtr_custom_resources.json> | ||
| { | { | ||
| - | | + | |
| - | "my_custom_sign": | + | "signs": |
| - | " | + | "rails": |
| - | "flip_texture": | + | "objects": |
| - | "custom_text": | + | "lifts": |
| - | "flip_custom_text": | + | |
| - | " | + | |
| - | " | + | |
| - | } | + | |
| - | } | + | |
| } | } | ||
| - | ``` | + | </ |
| + | |||
| + | ==== Explanation ==== | ||
| + | |||
| + | The file is quite self-explanatory; | ||
| + | |||
| + | <WRAP center round important 90%> | ||
| + | |||
| + | ==== Note on Naming ==== | ||
| + | |||
| + | By definition, Minecraft only supports the character set '' | ||
| + | |||
| + | If it works on your Minecraft instance, it means you have installed some mods which explicitly bypass this behavior. However they do not work for other people without such mod, and you are discouraged from using these invalid characters as much as possible. | ||
| + | |||
| + | As such, make sure to **never** include uppercase letters in your filenames or the ids inside the resource pack. Using them usually causes Minecraft to ignore it and revert to the default texture. | ||
| + | |||
| + | </ | ||
| + | |||
| + | ===== Let's get started on making some custom resources! ===== | ||
| - | ## Verifying | + | Follow |
| - | Use a [JSON validator](https:// | + | * [[mtr_extra: |
| + | * [[mtr_extra: | ||
| + | * [[mtr_extra: | ||
| + | * [[mtr_extra:resourcepack: | ||
| + | * [[mtr_extra: | ||
| + | * [[mtr_extra: | ||
| - | The resource pack (zip file) can be installed either clientside or as a server resource pack. If installed as a server resource pack, all players joining the server will be able to see the new additions after accepting the server resource pack. | ||
| - | [Download the example resource pack](https:// | ||
mtr/adding_custom_resources.1677138859.txt.gz · Last modified: 2023/02/23 07:54 by Zbx1425