Description
# Robot Mod - Complete Summary
## Overview
A Minecraft 1.20.1 Forge mod that adds three specialized robot entities that can perform automated tasks: mining, farming, and combat. Each robot has a specialized inventory system, equipment slots, and intelligent AI behaviors.
---
## Robot Types
### 1. **Miner Robot**
**Purpose:** Automated mining and resource collection
**Features:**
- Mines ores, stone, and cobblestone within a 32-block radius
- Uses vein mining (mines connected blocks of the same type)
- Requires a pickaxe in tool slot to function
- Can target specific blocks via special inventory slots
- Automatically collects drops into inventory
- Drops excess items when inventory is full
**Stats:**
- Health: 25 HP
- Movement Speed: 0.25
- Follow Range: 32 blocks
**Inventory Layout:**
- 1 Tool slot (pickaxe required)
- 3 Target slots (specify which blocks to mine, or leave empty for default behavior)
- 27 General inventory slots
- 4 Armor slots (helmet, chestplate, leggings, boots)
**How to Use:**
1. Craft and spawn a Miner Robot
2. Right-click to open inventory
3. Place a pickaxe in the tool slot
4. (Optional) Place blocks in target slots to specify what to mine
5. Set command position with commanding stick
6. Set mode to MINE
7. Robot will mine continuously within radius
---
### 2. **Gardner Robot**
**Purpose:** Automated farming - tilling, planting, harvesting, and replanting
**Features:**
- Tills dirt/grass blocks with a hoe
- Plants seeds automatically
- Harvests mature crops
- Auto-replants after harvesting
- Auto-refills seed slot from inventory every 5 seconds
- Can use bonemeal to speed up crop growth
- Works within 30-block radius
- Prevents farmland trampling
**Stats:**
- Health: 20 HP
- Movement Speed: 0.25
- Follow Range: 32 blocks
**Inventory Layout:**
- 1 Tool slot (hoe required)
- 1 Seed slot (wheat seeds, carrots, potatoes, etc.)
- 2 Additional special slots (currently unused)
- 27 General inventory slots
- 4 Armor slots
**Supported Crops:**
- Wheat
- Carrots
- Potatoes
- Beetroots
- Melons
- Pumpkins
**How to Use:**
1. Craft and spawn a Gardner Robot
2. Right-click to open inventory
3. Place a hoe in the tool slot
4. Place seeds in the seed slot
5. Set command position with commanding stick
6. Set mode to GARDEN
7. Robot will till, plant, and harvest continuously
**Behavior Priority:**
1. Harvest mature crops first
2. Plant seeds on empty farmland
3. Apply bonemeal to growing crops (if available)
4. Till new dirt/grass (only if seeds available)
---
### 3. **Soldier Robot**
**Purpose:** Automated combat and defense
**Features:**
- Attacks hostile mobs within range
- Uses equipped weapon for damage calculation
- Can wear armor for protection
- Follows owner
- Defends against threats
**Stats:**
- Health: 30 HP
- Base Attack Damage: 3.0 (increases with better weapons)
- Movement Speed: 0.3
- Follow Range: 32 blocks
**Inventory Layout:**
- 1 Tool slot (sword/weapon)
- 3 Special slots (currently unused)
- 27 General inventory slots
- 4 Armor slots (functional - reduces damage taken)
**Combat System:**
- Base damage + weapon damage = total attack
- Armor provides actual damage reduction
- Knockback on successful hits
**How to Use:**
1. Craft and spawn a Soldier Robot
2. Right-click to open inventory
3. Place a sword/weapon in tool slot
4. Equip with armor for protection
5. Set command position (optional, for guarding)
6. Set mode to DEFEND or FOLLOW
7. Robot will attack hostile entities
---
## Universal Features (All Robots)
### Command System
**Commanding Stick:** Used to set the robot's command position (home/work area)
- Craft: 1 stick + 1 redstone dust
- Right-click a block to set command position
- Right-click robot to clear command position
- Robot operates within radius of this position
### Mode System
All robots have different operational modes accessible via right-click menu:
- **FOLLOW:** Follow the owner
- **STAY:** Stay at current position
- **MINE/GARDEN/DEFEND:** Work mode (specific to robot type)
### Inventory System
**Specialized Inventory (36 slots total):**
- Slots 0-3: Armor (helmet, chestplate, leggings, boots)
- Slot 4: Tool slot (pickaxe, hoe, or sword)
- Slots 5-7: Special/Target slots (robot-specific)
- Slots 8-35: General inventory (27 slots)
**Item Pickup:**
- All robots automatically pick up nearby items
- Items go to general inventory only (not armor/tool slots)
- Excess items are dropped if inventory is full
**Functional Equipment:**
- Armor reduces damage taken (defense + toughness)
- Weapons increase attack damage
- Tools must be correct type for robot (pickaxe for miner, hoe for gardner, sword for soldier)
### Persistence
- Robots never despawn
- Maintain inventory between sessions
- Retain command position and mode settings
- Save all data to NBT
---
## GUI System
### Inventory Screen
Custom GUI texture with organized slot layout:
- Top panel: Specialized slots (armor, tool, targets/seeds)
- Middle panel: Robot's 27-slot general inventory
- Bottom panel: Player's inventory (27 slots + 9 hotbar)
**Slot Labels (in texture):**
- "Armor" - Left column (4 slots)
- "Tool" - Center slot (1 slot)
- "Special" - Right column (3 slots)
---
## Technical Details
### File Structure
```
robot-mod/
├── src/main/java/com/robotmod/
│ ├── RobotMod.java # Main mod class
│ ├── entity/
│ │ ├── RobotEntity.java # Base robot class
│ │ ├── MinerRobotEntity.java # Miner implementation
│ │ ├── GardnerRobotEntity.java # Gardner implementation
│ │ ├── SoldierRobotEntity.java # Soldier implementation
│ │ └── RobotMode.java # Mode enum
│ ├── inventory/
│ │ ├── SpecializedRobotInventory.java # Custom inventory
│ │ └── RobotMenu.java # Container menu
│ ├── client/
│ │ └── RobotScreen.java # GUI rendering
│ └── item/
│ └── CommandingStickItem.java # Command stick
├── src/main/resources/
│ └── assets/robotmod/
│ ├── textures/
│ │ ├── entity/ # Robot textures
│ │ └── gui/
│ │ └── robot_inventory.png # GUI texture
│ └── lang/
│ └── en_us.json # Translations
└── build.gradle # Build configuration
```
### Mod Information
- **Mod ID:** `robotmod`
- **Version:** 1.1.0
- **Minecraft Version:** 1.20.1
- **Forge Version:** 47.3.0
- **Mod Loader:** Forge
### Build System
- **Gradle:** 8.8
- **Build Command:** `gradlew.bat build`
- **Output:** `build/libs/robot-mod-1.1.0.jar`
---
## AI System
### Goal-Based AI
Each robot uses Minecraft's goal selector system with custom goals:
**Miner Robot Goals:**
1. Priority 0: Float (swim)
2. Priority 1: Mining goal (find and mine blocks)
3. Priority 6: Look at player
4. Priority 7: Random look around
**Gardner Robot Goals:**
1. Priority 0: Float
2. Priority 1: Farming goal (harvest, plant, bonemeal)
3. Priority 2: Till farmland goal
4. Priority 6: Look at player
5. Priority 7: Random look around
**Soldier Robot Goals:**
1. Priority 0: Float
2. Priority 1: Follow owner
3. Priority 2: Melee attack
4. Priority 3: Defend owner from threats
5. Priority 6: Look at player
6. Priority 7: Random look around
### Idle Detection & Recovery
- Robots check every second (20 ticks) if they're idle
- If no goals are running, forces goal re-evaluation
- Prevents robots from getting permanently stuck
- Continuously searches for work within their radius
---
## Crafting Recipes
### Miner Robot Spawn Egg
```
[Iron Block] [Redstone] [Iron Block]
[Iron Block] [Iron Pickaxe] [Iron Block]
[Iron Block] [Furnace] [Iron Block]
```
**Cost:** 6 Iron Blocks + 1 Redstone + 1 Iron Pickaxe + 1 Furnace
### Gardner Robot Spawn Egg
```
[Iron Block] [Redstone] [Iron Block]
[Iron Block] [Iron Hoe] [Iron Block]
[Iron Block] [Composter] [Iron Block]
```
**Cost:** 6 Iron Blocks + 1 Redstone + 1 Iron Hoe + 1 Composter
### Soldier Robot Spawn Egg
```
[Iron Block] [Redstone] [Iron Block]
[Iron Block] [Iron Sword] [Iron Block]
[Iron Block] [Iron Chestplate] [Iron Block]
```
**Cost:** 6 Iron Blocks + 1 Redstone + 1 Iron Sword + 1 Iron Chestplate
---
## Commands
### Summon Robots
```
/summon robotmod:miner_robot ~ ~ ~
/summon robotmod:gardner_robot ~ ~ ~
/summon robotmod:soldier_robot ~ ~ ~
```
---
## Known Issues & Debug
### Debug Mode
Current build includes extensive debug logging for troubleshooting:
- Logs every tick check (every second)
- Logs goal execution
- Logs work search results
- Check logs at: `.minecraft/logs/latest.log`
### Common Issues
1. **Robot gets stuck:** Check debug logs to see why goals aren't running
2. **Not mining/farming:** Ensure proper tool in tool slot and correct mode set
3. **Inventory full:** Robot will drop excess items on ground
4. **Won't find work:** Check command radius - robot must be within range
### Performance Notes
- Work cooldowns reduced to 1-2 ticks for responsive behavior
- Goals check continuously when idle
- Vein mining limited to 64 blocks to prevent lag
---
## Future Enhancements
### Planned Features
- [ ] Crafting recipes for robot spawning
- [ ] Robot upgrade system
- [ ] Energy/fuel system
- [ ] More robot types (lumberjack, builder, fisher/hunter)
- [ ] Team/group management
- [ ] Waypoint system for complex tasks
- [ ] Filter system for mining/farming specific items
- [ ] Remote control interface
- [ ] Robot stat upgrades
### Known Limitations
- Robots may occasionally get stuck (debug mode helps diagnose)
- No energy/durability system yet (robots work indefinitely)
- Limited to single-block operations (no multi-block structures)
- Cannot navigate complex terrain (limited pathfinding)
## Credits
**Mod Author:** Jason Pender
**Minecraft Version:** 1.20.1
**Mod Loader:** Forge 47.3.0
## Changelog
### Version 1.1.0 (Current)
- Added functional armor system (reduces damage)
- Added functional weapon system (increases attack damage)
- Added automatic item pickup for all robots
- Implemented auto-refill system for Gardner seeds
- Fixed robots getting stuck after completing tasks
- Reduced work cooldowns for responsive behavior
- Added idle detection and recovery system
- Created proper GUI texture with organized layout
- Removed text overlap in inventory screen
- Added extensive debug logging for troubleshooting
### Version 1.0.0 (Initial)
- Basic robot entities (Miner, Gardner, Soldier)
- Specialized inventory system
- Command stick for position setting
- Mode system for robot control
- Custom GUI rendering
- Vein mining for Miner robot
- Auto-farming for Gardner robot
- Combat system for Soldier robot
*Last Updated: October 13, 2025*


