Stations - morelandjo/Railways-Untold GitHub Wiki

Stations

Railways Untold supports multiple station designs that can be placed at villages and at the starting track position. Stations are defined via data packs, allowing you to add custom station schematics, control which biomes they appear in, and set relative rarity between designs.

How It Works

The mod loads station definitions from data packs at startup and on /reload. When a station needs to be placed (at a village or at the starting position), the mod:

  1. Collects all loaded station definitions
  2. Filters by the biome at the placement position (whitelist/blacklist)
  3. Filters by appearance limits — excludes stations that have reached their max_appearances
  4. Selects one station using weighted random selection
  5. Validates the schematic and places it with proper track alignment

If no data pack stations match the biome, the built-in default station is used as a fallback.

Config Settings

These settings remain in config/railways-untold/config.toml:

Setting Default Description
stationAtStart true Whether to place a station at the starting track position (next to the starting train).
stationFoundationBlock "minecraft:cobblestone" Global default block used for station foundations when placed above air. Can be overridden per-station in the JSON.

Station placement at villages is controlled by the structure targeting system. See the Biome Settings documentation for structure_target_tags.

File Location

Place your station definition JSON files at:

data/<namespace>/railwaysuntold/stations/<name>.json

Place the corresponding .nbt schematic files at:

data/<namespace>/structure/<path>.nbt

For example, in a data pack called my_stations:

my_stations/
  pack.mcmeta
  data/
    my_stations/
      railwaysuntold/
        stations/
          desert_station.json
          grand_station.json
      structure/
        stations/
          desert_station.nbt
          grand_station.nbt

JSON Format

{
  "schematic": "my_stations:stations/desert_station",
  "weight": 10,
  "foundation_block": "minecraft:cut_sandstone",
  "biome_whitelist": ["minecraft:desert"],
  "biome_blacklist": [],
  "loot": {
    "default": "my_stations:stations/station_supplies"
  }
}

Field Reference

Field Type Required Default Description
schematic string Yes Resource location of the .nbt schematic. Resolves to data/<namespace>/structure/<path>.nbt. For example, "my_stations:stations/desert_station" loads data/my_stations/structure/stations/desert_station.nbt.
weight integer No 10 Relative weight for random selection. Higher values mean the station is chosen more often.
foundation_block string No (global config) Block used for the station foundation when placed above air. If omitted, uses the global stationFoundationBlock config value.
biome_whitelist string array No [] If non-empty, the station can only be placed in these biomes. Supports biome IDs ("minecraft:plains") and biome tags ("#minecraft:is_forest"). An empty array means all biomes.
biome_blacklist string array No [] The station will never be placed in these biomes. Applied after the whitelist.
max_appearances integer No (unlimited) Maximum number of times this station can be placed in a world. Once reached, the station is excluded from selection. Omit or set to -1 for unlimited.
loot object No (none) Loot table configuration for containers in this station's schematic. See Loot Tables below.

Schematic Requirements

Station schematics must meet the same validation requirements as event schematics:

  • Edge-to-edge track: The schematic must contain Create track blocks on exactly two opposite edges (entry and exit)
  • Flat track: All track blocks must be at the same Y level within the schematic
  • Straight alignment: Track must run in a straight line from one edge to the opposite edge

Create Station Blocks

If your schematic includes Create station blocks (the block that creates a named stop on the railway network), the mod will automatically detect and configure them. Station blocks are oriented to face the track and assigned a shared station name.

If no Create station blocks are found in the schematic, the mod will automatically place them adjacent to the track on both sides of the station.

Creating Station Schematics

  1. Build your station in-game with Create tracks running through it edge-to-edge
  2. Optionally include Create station blocks at the track positions
  3. Use a schematic tool (like Create's Schematic and Quill) to save the structure as a .nbt file
  4. Place the .nbt file in your data pack's structure/ directory

Built-In Default

The mod ships with a built-in default station definition:

data/railwaysuntold/railwaysuntold/stations/default_station.json

{
  "schematic": "railwaysuntold:station",
  "weight": 10,
  "biome_whitelist": [],
  "biome_blacklist": []
}

This uses the bundled station.nbt schematic. You can override it by creating a file at the same path in your data pack, or add additional station designs alongside it.

Examples

Desert Station

A sandstone station that only appears in deserts:

data/my_stations/railwaysuntold/stations/desert_station.json

{
  "schematic": "my_stations:stations/desert_station",
  "weight": 10,
  "foundation_block": "minecraft:cut_sandstone",
  "biome_whitelist": ["minecraft:desert"],
  "biome_blacklist": []
}

Grand Station (Rare)

A large, ornate station that can appear anywhere but is rare:

data/my_stations/railwaysuntold/stations/grand_station.json

{
  "schematic": "my_stations:stations/grand_station",
  "weight": 3,
  "biome_whitelist": [],
  "biome_blacklist": ["#minecraft:is_ocean", "#minecraft:is_nether"]
}

Unique Grand Station

A grand station that can only appear once in the entire world:

data/my_stations/railwaysuntold/stations/grand_central.json

{
  "schematic": "my_stations:stations/grand_central",
  "weight": 5,
  "max_appearances": 1,
  "biome_whitelist": [],
  "biome_blacklist": ["#minecraft:is_ocean"]
}

Biome-Specific Stations

You can create multiple station designs for different biomes. The mod selects from whichever designs match the current biome:

stations/
  plains_station.json    -> biome_whitelist: ["minecraft:plains", "minecraft:sunflower_plains"]
  forest_station.json    -> biome_whitelist: ["#minecraft:is_forest"]
  mountain_station.json  -> biome_whitelist: ["#minecraft:is_mountain"]
  default_station.json   -> biome_whitelist: [] (catches everything else)

When placing at a forest village, only forest_station.json and default_station.json would be eligible, and one is chosen by weight.

Station Selection

At Villages

When a track reaches a targeted village, the mod:

  1. Evaluates runway positions around the village edge
  2. Selects a station design based on the village center's biome
  3. Places the station at the best runway position with proper alignment

The same station design is used for all evaluation and placement within a single village.

At Spawn

When stationAtStart is enabled, the starting station is selected randomly from all definitions that match the spawn position's biome.

Loot Tables

You can assign loot tables to containers (chests, barrels, etc.) in station schematics. The loot system works identically to event loot tables — see the Events documentation for full details on the loot configuration format, container tagging, and resolution order.

Example: Station with Loot

{
  "schematic": "my_stations:stations/trading_post",
  "weight": 10,
  "loot": {
    "by_tag": {
      "merchant_goods": "my_stations:loot/merchant_inventory",
      "storage": "my_stations:loot/station_storage"
    },
    "default": "my_stations:loot/basic_supplies"
  }
}

Reloading

Station definitions are loaded as part of Minecraft's data pack system. Changes take effect:

  • When starting/loading a world
  • After running the /reload command

No server restart is required.

⚠️ **GitHub.com Fallback** ⚠️