Описание
# Middle-Earth NPC
[](https://minecraft.net/)
[](https://fabricmc.net/)
[](LICENSE)
## Overview
**Middle-Earth NPC** transforms the citizens of Middle-earth into interactive merchants and traders. Assign roles to NPCs, establish faction-based commerce, and create a living economy across all nine major factions of Middle-earth.
## Features
### NPC Role System
- **Blacksmith Role**: NPCs sell weapons, armor, raw materials, and enchanted books
- **Farmer Role**: NPCs offer food, crops, and agricultural supplies
- Automatic workstation detection (anvils for blacksmiths, composters for farmers)
- Smart AI pathfinding to claim and maintain workstations
### Faction-Based Trading
- Unique shop inventories for all 9 Middle-earth factions:
- **Gondor**, **Rohan**, **Shire**, **Isengard**
- **Lothlorien**, **Longbeards**, **Mordor**, **Misties**, **Dale**
- Faction-specific items and pricing using Middle-earth currency (copper, silver, gold coins)
- Configurable shop data via JSON files
### Role Management
- Use `/npcrole ` to assign roles manually
- Right-click interaction system for pending role assignments
- Only Civilian and Militia rank NPCs can be assigned roles
- Persistent data storage across world saves
### Datapack Customization
- Override default shops using datapacks
- Create `data/me-npc/farmer/.json` or `data/me-npc/blacksmith/.json`
- Customize items and prices for any faction's merchants
- Example: `data/me-npc/farmer/gondor.json` to modify Gondor farmer inventory
## How to Use
1. Find a Civilian or Militia NPC from any faction
2. Use `/npcrole blacksmith` or `/npcrole farmer` near the NPC
3. Right-click the NPC to confirm role assignment
4. The NPC will seek nearby workstations and begin trading
5. Use `/npcrole clear` to remove roles if needed
## Requirements
- Minecraft: **1.21.1**
- Fabric Loader + Fabric API
- Middle-earth Mod (1.5.3-1.21.1-alpha or compatible)
## Installation
1. Install Fabric Loader and Fabric API
2. Install the Middle-earth mod
3. Install Cardinal Components API
4. Drop this mod jar into your `mods` folder
5. Launch and start building your Middle-earth economy
## Technical Details
- Fabric-ready with client and server support
- Mixin-based entity extensions for seamless integration
- Data-driven shop configurations for easy customization
- Persistent NPC role data using Cardinal Components
## License & Credits
- License: see [LICENSE](LICENSE)
- Built for the Middle-earth mod community
- Thanks to the Fabric and Cardinal Components teams
> Transform your Middle-earth settlements into thriving centers of commerce and trade