Minecraft Money Mod Development
This skill provides assistance for developing the MC-Money mod, a NeoForge modification for Minecraft 1.21.1 that implements a complete currency system including coins, personal banking, and configurable shops.
Project Overview
MC-Money is a Minecraft mod built on NeoForge for version 1.21.1. The mod adds economic gameplay mechanics through a currency system with multiple coin types, player banking capabilities, and shop functionality.
Instructions
When assisting with this project, follow these guidelines:
1. Understanding the Project Structure
The mod follows standard NeoForge project layout:
**Java source code**: `src/main/java/`**Assets** (textures, models, language files): `src/main/resources/`**Mod metadata templates**: `src/main/templates/`2. Key Classes and Their Roles
Familiarize yourself with these core classes:
`MinecraftMoney.java` - Main mod entry point and initialization`item/ModItems.java` - Central item registration handler`item/CoinItem.java` - Coin item implementation with deposit functionality`data/PlayerCurrencyData.java` - Player currency storage using NeoForge attachment system`command/CurrencyCommand.java` - Currency management command implementation3. Working with Coins and Currency
When implementing or modifying currency features:
Use the attachment system (`PlayerCurrencyData.java`) for persistent player dataEnsure coin items follow the established pattern in `CoinItem.java`Maintain consistency across all coin tiers (copper, silver, gold, platinum)Remember that coins should have deposit functionality4. Textures and Assets
All item textures must be:
16x16 pixel PNG formatLocated in `src/main/resources/assets/minecraftmoney/textures/item/`Named consistently: `copper_coin.png`, `silver_coin.png`, `gold_coin.png`, `platinum_coin.png`, `money_bag.png`When creating or modifying textures, maintain visual consistency with Minecraft's art style.
5. Building and Testing
**To build the mod:**
```bash
./gradlew build
```
**To test in development environment:**
```bash
./gradlew runClient
```
Always test changes in the development client before building for distribution.
6. NeoForge Best Practices
Use NeoForge's registration systems (DeferredRegister) for items, blocks, and other registry objectsLeverage the attachment system for persistent player data rather than custom save handlersFollow NeoForge event handling patternsEnsure thread safety when accessing player dataUse proper resource locations with the mod ID namespace7. Commands and Gameplay
When working on currency commands:
Follow the existing pattern in `CurrencyCommand.java`Provide appropriate permission checksInclude helpful error messages and feedbackSupport both player and console execution where appropriate8. Code Organization
Maintain the existing package structure:
Items in `item/` packageData management in `data/` packageCommands in `command/` packageKeep the main class minimal, delegating to specialized handlersConstraints
Target Minecraft version: 1.21.1Modding platform: NeoForge (not Forge or Fabric)All textures must be 16x16 pixelsUse NeoForge's modern attachment system for data storageFollow Java naming conventions and Minecraft modding standardsExamples
**Adding a new coin type:**
1. Create texture in `src/main/resources/assets/minecraftmoney/textures/item/`
2. Register item in `ModItems.java` using DeferredRegister
3. Extend or reference `CoinItem.java` for deposit functionality
4. Add translation key to language files
**Modifying currency storage:**
1. Update `PlayerCurrencyData.java` attachment data structure
2. Ensure serialization/deserialization handles new fields
3. Update related commands in `CurrencyCommand.java`
4. Test data persistence across game sessions