mznistuff

Create a train addon that allows players to design customizable trains featuring various car types such as cargo, passenger, and engine cars. Implement mechanics for laying tracks and creating stations through a user-friendly INVENTORY GUI for boarding, alongside support for redstone interactions to manage train movement and stops. Include configurable speed settings, unique sounds for each train type, custom rail designs, and the option to feature BNSF train models for an immersive experience.

Kodari AI
KodariJul 2 at 4:20 pm 42

I’ll build a train mod centered on custom minecart-based cars with coupling, throttle-controlled engines, an inventory-boarding station GUI, custom rails, and a customizable livery system (including a BNSF-style freight skin players can texture themselves).

TrainWorks
Adds customizable trains built from Engine, Passenger, and Cargo minecart-style cars that couple together and move as a unit. Includes custom track and brake rails, station blocks with an inventory GUI for boarding trains, redstone-controlled stops, configurable per-car top speeds, unique sounds per car type, and swappable liveries including a BNSF-style freight skin. Config file lets server owners tune speeds and sounds.

No curated docs available for this — proceeding with known Fabric 1.20.4 APIs.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
gradle.properties
settings.gradle
Code
6 140
src/main/java/com/trainworks/TrainWorksMod.java
package com.trainworks;

import com.trainworks.config.TrainConfig;
import com.trainworks.registry.ModBlockEntities;
import com.trainworks.registry.ModBlocks;
import com.trainworks.registry.ModEntities;
import com.trainworks.registry.ModItemGroups;
import com.trainworks.registry.ModItems;
import com.trainworks.registry.ModScreenHandlers;
import com.trainworks.registry.ModSounds;
import net.fabricmc.api.ModInitializer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class TrainWorksMod implements ModInitializer {
	public static final String MOD_ID = "trainworks";
	public static final Logger LOGGER = LoggerFactory.getLogger(MOD_ID);

	@Override
	public void onInitialize() {
		TrainConfig.load();
		ModSounds.register();
		ModBlocks.register();
		ModBlockEntities.register();
		ModItems.register();
		ModEntities.register();
		ModScreenHandlers.register();
		ModItemGroups.register();
	}
}