User Tools

Site Tools


mtr:adding_custom_resources

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
mtr:adding_custom_resources [2023/02/23 07:19] – created Zbx1425mtr:adding_custom_resources [2025/11/21 17:20] (current) – Grammar correction Navi
Line 1: Line 1:
-Adding Custom Resources+====== 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://github.com/jonafanho/Minecraft-Transit-Railway/wiki/Trains+  * Texture variants for existing [[/trains|trains]
-* New textures or text for [railway signs](https://github.com/jonafanho/Minecraft-Transit-Railway/wiki/Railway-Sign)+  * Blockbench models (BBmodelfor [[/trains|trains]] 
 +  * New textures and/or text for [[/railway_sign|railway signs]]
  
-It is highly recommended to be familiar with [creating a resource pack](https://minecraft.fandom.com/wiki/Tutorials/Creating_a_resource_pack) before proceeding with this guide.+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/mtr/mtr_custom_resources.json`.+This guide will tell you how to set up your file structure to make a resource pack.
  
-## Adding Texture Variants for Existing Trains+Requirements: Windows 10 21H1 or later.
  
-To add texture variants, the `custom_trains` JSON object should be added to `mtr_custom_resouces.json`. Each JSON object under `custom_trains`, representing a texture variant for a train, should have a unique key and serveral required entries.+===== Guide =====
  
-| Key | Data Type | Description | Notes | +==== Folder structure ====
-| --- | --- | --- | --- | +
-| `name` | String | The name to be shown on [dashboards](https://github.com/jonafanho/Minecraft-Transit-Railway/wiki/Dashboards) when selecting trains for a route | Required | +
-| `color` | String (colour hex code) | The colour to be shown on [dashboards](https://github.com/jonafanho/Minecraft-Transit-Railway/wiki/Dashboards) when selecting trains for a route | Optional, defaults to the colour black if none specified | +
-| `base_train_type` | String (train ID) | The train model to apply the texture on | Required, see [the trains page](https://github.com/jonafanho/Minecraft-Transit-Railway/wiki/Trains) for a list of train identifiers | +
-| `texture_id` | String (texture ID) | The [namespaced ID](https://minecraft.fandom.com/wiki/Namespaced_ID) of the texture file | Required |+
  
-An example is shown below.+  - Go to your //.minecraft// folder. {{:mtr_extra:resourcepack:minecraft_folder.png?200&nolink}}  
 +  - Then find the //resourcepacks// folder {{:mtr_extra:resourcepack:screenshot_2023-05-16_211152.png?200&nolink}}  
 +  - Create a folder with a name that you want (for example: My custom M-Train) {{:mtr_extra:resourcepack:screenshot_2023-05-16_211341.png?200&nolink}} 
 +  - Create a new folder inside of the existing folder called ''assets''.  
 +  - 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>
 { {
-  "custom_trains": { +    "pack": { 
-    "my_custom_train": +        "description": "put your pack description here", 
-      "name": "My Custom SP1900 Train", +        "pack_format": 9
-      "color": "FEC5E5", +
-      "base_train_type": "sp1900", +
-      "texture_id": "mtr:custom_directory/custom_sp1900.png"+
     }     }
-  } 
 } }
-```+</code>
  
-## Adding New Railway Sign Textures or Text+<WRAP center round info 90%>
  
-To add new [railway signs](https://github.com/jonafanho/Minecraft-Transit-Railway/wiki/Railway-Sign) textures or text, the `custom_signs` JSON object should be added to `mtr_custom_resouces.json`Each JSON object under `custom_signs`, representing new signshould have a unique key and serveral required entries.+The pack format is what version of Minecraft the pack is for. If you are only adding MTR models or texturesthis is not important. \\  However, if you feel the need to add a number, it is recommended to use 8 or 9, as they correspond to versions 1.18 and 1.19 respectively. \\  If pack tells you it's "not compatible"just remember that the only thing that changes that is this number, so it really doesn't say much.
  
-| Key | Data Type | Description | Notes | +</WRAP>
-| --- | --- | --- | --- | +
-| `texture_id` | String (texture ID) | The [namespaced ID](https://minecraft.fandom.com/wiki/Namespaced_ID) of the texture file | Required | +
-| `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 ''mtr_custom_resources.json''
  
-```+==== JSON files ==== 
 + 
 +The main code for all custom resources is here: 
 + 
 +<code json mtr_custom_resources.json>
 { {
-  "custom_signs": { +    "vehicles": [], 
-    "my_custom_sign": +    "signs": []
-      "texture_id": "mtr:custom_directory/custom_sign.png"+    "rails": []
-      "flip_texture": false+    "objects": []
-      "custom_text": "你好|Hello"+    "lifts": []
-      "flip_custom_text": false, +
-      "small": true, +
-      "background_color": "1167B1" +
-    } +
-  }+
 } }
-```+</code> 
 + 
 +==== Explanation ==== 
 + 
 +The file is quite self-explanatory; custom resources about trains, boats, cable cars and airplanes should be put under ''vehicles'', signs in ''signs'', and so on. 
 + 
 +<WRAP center round important 90%> 
 + 
 +==== Note on Naming ==== 
 + 
 +By definition, Minecraft only supports the character set ''a-z'', ''0-9'', ''/._-''. This means characters such as uppercase letters **is not allowed and will not work**. 
 + 
 +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. 
 + 
 +</WRAP> 
 + 
 +===== Let's get started on making some custom resources! =====
  
-## Verifying the Resource Pack+Follow the links below to get started with making your train. Good luck!
  
-Use a [JSON validator](https://jsonlint.com/) to check for any syntax errors of the JSON files.+  * [[mtr_extra:resourcepack:make:texture|Retexturing an existing train]] - Using the same models but different textures 
 +  * [[mtr_extra:resourcepack:make:model|Modelling train]] - Creating a train from scratch 
 +  * [[mtr_extra:resourcepack:make:others#adding_a_sign|Creating signs]] - Adding your customised signs into your game 
 +  * [[mtr_extra:resourcepack:make:others#adding_custom_rails|Creating rails]] - Adding new types of rails into your game 
 +  * [[mtr_extra:resourcepack:make:others#adding_custom_objects|Creating objects]] - Adding decoration objects into your game 
 +  * [[mtr_extra:resourcepack:make:others#adding_custom_lifts|Creating lifts]] - Adding retextures of lifts into your game
  
-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://github.com/jonafanho/Minecraft-Transit-Railway/blob/master/examples/MTR%20Custom%20Resources.zip?raw=true) to see a full example and to test out the functionality. 
mtr/adding_custom_resources.1677136789.txt.gz · Last modified: 2023/02/23 07:19 by Zbx1425