Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Minecraft Forge MOD template with automated WSL/Windows development workflow

License

Unknown, Unknown licenses found

Licenses found

Unknown
LICENSE.txt
Unknown
LICENSE-MOD.txt
Notifications You must be signed in to change notification settings

ojiman/minecraft-forge-mod-template

Repository files navigation

Example Minecraft Forge MOD

A template/example Minecraft Forge MOD for version 1.21.4 with automated development workflow for WSL/Windows environments.

Features

This MOD adds:

  • Example Block: A new buildable block with stone-like properties
  • Example Item: A food item that can be consumed anytime
  • Example Tab: A custom creative mode tab to organize MOD items

Development Environment

  • Minecraft: 1.21.4
  • Forge: 54.1.0
  • Java: 21
  • Gradle: 8.12.1

Quick Start

Prerequisites

  • Java 21
  • WSL2 (for Windows users)
  • Minecraft with Forge 1.21.4-54.1.0 installed

Building the MOD

# Quick build (skips tests for faster development)
./quick-build.sh

# Full build with tests
./gradlew build

Development Workflow (WSL + Windows)

For WSL users developing for Windows Minecraft:

  1. Auto-watch and deploy:

    ./watch-build.sh

    This will:

    • Monitor src/ directory for changes
    • Automatically rebuild when Java files are modified
    • Deploy the MOD to Windows Minecraft mods folder
  2. Manual deployment:

    ./deploy-mod.sh
  3. VS Code Integration:

    • Use Ctrl+Shift+P → "Tasks: Run Task"
    • Available tasks:
      • "Watch & Auto-Deploy"
      • "Quick Build"
      • "Deploy MOD to Windows"

Manual Installation

  1. Build the MOD: ./gradlew build
  2. Copy build/libs/examplemod-1.0.0.jar to your Minecraft mods/ folder
  3. Launch Minecraft with Forge 1.21.4-54.1.0

Project Structure

src/main/java/com/example/examplemod/
├── ExampleMod.java          # Main MOD class
└── Config.java              # Configuration management

Scripts:
├── quick-build.sh           # Fast development build
├── watch-build.sh           # Auto-watch and deploy
└── deploy-mod.sh            # Deploy to Windows

MOD Development Notes

Adding New Items

// Register a new item
public static final RegistryObject<Item> MY_ITEM = ITEMS.register("my_item",
    () -> new Item(new Item.Properties().setId(ITEMS.key("my_item")))
);

Adding New Blocks

// Register a new block
public static final RegistryObject<Block> MY_BLOCK = BLOCKS.register("my_block",
    () -> new Block(BlockBehaviour.Properties.of().setId(BLOCKS.key("my_block")))
);

// Register the block item
public static final RegistryObject<Item> MY_BLOCK_ITEM = ITEMS.register("my_block",
    () -> new BlockItem(MY_BLOCK.get(), new Item.Properties().setId(ITEMS.key("my_block")))
);

Configuration

The MOD uses Forge's configuration system. Configuration files are generated in:

  • Single player: saves/[world]/serverconfig/
  • Dedicated server: serverconfig/

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Test thoroughly
  5. Submit a pull request

License

This project is licensed under the MIT License - see the LICENSE.txt file for details.

Acknowledgments

  • Built with Minecraft Forge MDK
  • Uses the standard Forge development patterns
  • Optimized for WSL/Windows development workflow

About

Minecraft Forge MOD template with automated WSL/Windows development workflow

Resources

License

Unknown, Unknown licenses found

Licenses found

Unknown
LICENSE.txt
Unknown
LICENSE-MOD.txt

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published