# BuffMobs v2.5.1 - Tactical Retreat Update
## 🎯 What's New
### ✨ Tactical Retreat System
Ranged mobs (skeletons, piglins, pillagers) can now intelligently retreat when players get too close, creating more dynamic and challenging combat encounters!
**New Behavior Modes:**
- **Melee Mode** (default): Ranged mobs switch to melee weapons when close, just like before
- **Retreat Mode** (NEW!): Ranged mobs tactically back away 8-12 blocks while continuing to shoot
- **Random Mode** (NEW!): Each mob randomly chooses between melee or retreat behavior when spawned
**How it works:**
- When a player gets within the configured distance (default: 4 blocks), the mob activates its behavior
- In Retreat mode, mobs back away for 3 seconds (configurable), then have a 5-second cooldown
- Mobs maintain eye contact with the player while retreating
- Smart pathfinding ensures mobs don't retreat into walls or dangerous areas
### ⚙️ New Configuration Options
**Ranged/Melee Switching:**
- `behaviorMode`: Choose "melee", "retreat", or "random" (default: "melee")
- `retreatSpeed`: How fast mobs retreat (default: 1.2 = 20% faster than normal)
- `retreatDuration`: How long mobs retreat in ticks (default: 60 = 3 seconds)
**Example configurations:**
```toml
# Aggressive melee rushers
behaviorMode = "melee"
# Tactical kiting mobs
behaviorMode = "retreat"
retreatSpeed = 1.5
retreatDuration = 80
# Unpredictable variety
behaviorMode = "random"
```
## 🔧 Technical Details
### New Files Added:
- `RangedBehaviorMode.java` - Enum defining the three behavior modes
- `TacticalRetreatGoal.java` - Custom AI goal for retreat behavior
### Updated Systems:
- `RangedMobAIManager.java` - Now supports all three behavior modes
- `BuffMobsConfig.java` - Added new retreat configuration options
- Enhanced mob state tracking to remember chosen behavior
### Performance:
- Retreat AI only activates when needed
- Built-in cooldowns prevent excessive pathfinding calculations
- No performance impact when using melee mode
## 🎮 Use Cases
**PvE Difficulty Servers:**
Use melee mode for aggressive close-combat challenges where skeletons rush players with swords.
**Tactical Combat Servers:**
Use retreat mode to make ranged mobs harder to reach, forcing players to use strategy and positioning.
**Variety Servers:**
Use random mode to keep players on their toes - you never know if a skeleton will charge or kite!
## 🔄 Compatibility
✅ **Fully backward compatible** - If you don't change the config, the mod works exactly as before
✅ **Works with all existing features** - Day scaling, dimension scaling, presets, weapon progression
✅ **Works with all supported mobs** - Skeletons, Strays, Wither Skeletons, Piglins, Pillagers, and custom ranged mobs
✅ **NeoForge 1.21.10** - Fully ported from Fabric with all features intact
## 📋 Full Feature List
**Core Systems:**
- Configurable attribute multipliers (Health, Damage, Speed, Attack Speed, Armor, Toughness)
- Day-based progressive difficulty scaling
- Dimension-specific scaling with 5 customizable slots
- Mob preset system for specific mob types
- Comprehensive filtering (mobs, mods, dimensions)
**Combat Systems:**
- Ranged/Melee AI switching with three behavior modes (NEW!)
- Progressive weapon unlocking system
- Enchantment progression system
- Harmful effects on players (Poison, Slowness, Wither)
**Configuration:**
- Native NeoForge TOML configuration
- Detailed in-file comments for every option
- Hot-reloadable with `/reload` command
- Debug commands for testing and troubleshooting
## 🐛 Bug Fixes
- Fixed MobEffects API calls for NeoForge 1.21.10
- Fixed enchantment registry access
- Fixed PathfinderMob compatibility in retreat AI
- Corrected all effect names (STRENGTH, RESISTANCE, SLOWNESS)
## 📖 Documentation
Full documentation available in the config file with detailed comments explaining every option.
**Need help?**
- Check the config comments for detailed explanations
- Use `/buffmobs debug` to inspect nearby mobs
- Report issues on [GitHub](https://github.com/Khotyz/BuffMobs/issues)
## 🔗 Links
- **Download:** [Modrinth](https://modrinth.com/mod/buffmobs) | [CurseForge](https://www.curseforge.com/minecraft/mc-mods/buffmobs)
- **Source Code:** [GitHub](https://github.com/Khotyz/BuffMobs)
- **Report Issues:** [GitHub Issues](https://github.com/Khotyz/BuffMobs/issues)
---
**Minecraft Version:** 1.21.10
**Mod Loader:** NeoForge 21.10.41+
**License:** MIT
*Thank you for using BuffMobs! If you enjoy the mod, consider leaving a like on Modrinth or CurseForge.*
Developer information
Projects on Modrinth are automatically available through a Maven repository for use with JVM build tools such as Gradle.
maven { name = "Modrinth"; url = "https://api.modrinth.com/maven" }