Описание
# Spawning Overhaul
A Minecraft mod that creates a more immersive mob spawning system based on environmental factors like caves, forests, and structures.
## Features
### Environment-Based Spawning
Instead of mobs spawning uniformly everywhere, this mod makes spawning rates dependent on the spawn location's environment:
- **Base Multiplier**: Configure a global spawn rate that applies everywhere (default: 0.2x)
- **Cave Spawning**: Progressive scaling based on depth
- Shallow caves (Y=60): Minimum multiplier (default: 1.0x = 20% acceptance)
- Deep caves (Y=-64): Maximum multiplier (default: 5.0x = 100% acceptance)
- The deeper you go, the more dangerous it gets!
- **Forest Spawning**: Progressive scaling based on tree density
- Sparse areas: Minimum multiplier (default: 1.0x)
- Dense forests/jungles: Maximum multiplier (default: 3.0x)
- More trees = more danger
- **Structure Spawning**: Dangerous structures have increased spawn rates (default: 3.0x)
- Strongholds, Nether Fortresses, Ocean Monuments, Woodland Mansions, Mineshafts, Dungeons
**Note:** Spawn multipliers use normalized probability acceptance based on the highest configured multiplier. With default settings (maxCaveMultiplier = 5.0), the reference is 5.0x:
- 0.2x base = 4% acceptance (0.2/5.0)
- 1.0x shallow caves = 20% acceptance (1.0/5.0)
- 5.0x deep caves = 100% acceptance (5.0/5.0)
This creates dramatic contrast: deep caves have 25x more spawns than the surface!
### Mob-Specific Rules
Configure special spawn restrictions for specific mobs:
- **Spider Only In Cave** (Enabled by default)
- When enabled: Spiders and cave spiders only spawn in caves
- When disabled: Spiders spawn normally everywhere
- **Disable Creeper Near Structure** (Disabled by default)
- When enabled: Prevents creepers from spawning in dangerous structures (protects against griefing)
- When disabled: Creepers spawn normally in structures
### In-Game Debug Command
Use `/spawndebug` to see what spawn rates would apply at your current position:
- Environment detection at your position (cave, forest density, structure)
- Active spawn multipliers and their ranges
- Which multiplier would be used (base, cave, or forest)
- Final calculated spawn rate if a mob were to spawn here
This shows you what the spawn system "sees" at your position.
Requires operator level 2 (use `/op `)
## Configuration
The mod creates a config file at `config/spawningoverhaul.json5`
### Accessing the Config GUI
**Fabric:**
- Install [Mod Menu](https://modrinth.com/mod/modmenu)
- Click "Mods" in the main menu
- Find "Spawning Overhaul" and click the config button
**NeoForge:**
- Click "Mods" in the main menu
- Find "Spawning Overhaul" and click "Config"
### Configuration Options
#### Environmental Multipliers
| Option | Default | Description |
|--------|---------|-------------|
| Enable Immersive Spawning | ✅ Enabled | Master toggle for the entire system |
| Base Multiplier | 1.0x | Global spawn rate applied everywhere |
| Min Cave Multiplier | 1.0x | Spawn rate at shallowest cave depth (Y=60) |
| Max Cave Multiplier | 5.0x | Spawn rate at deepest depth (Y=-64) |
| Min Forest Multiplier | 1.0x | Spawn rate in sparse areas |
| Max Forest Multiplier | 3.0x | Spawn rate in dense forests |
| Dangerous Structure Multiplier | 3.0x | Additional multiplier in dangerous structures |
| Enable Structure Modifications | ✅ Enabled | Apply structure-based spawn changes |
#### Mob-Specific Rules
| Option | Default | Description |
|--------|---------|-------------|
| Spider Only In Cave | ✅ Enabled | Restricts spiders to caves only |
| Disable Creeper Near Structure | ❌ Disabled | Prevents creepers in structures (anti-griefing) |
#### Detection Settings
| Option | Default | Description |
|--------|---------|-------------|
| Dense Forest Log Threshold | 50 | Number of logs needed to count as dense forest |
| Dense Forest Scan Radius | 10 | Radius in blocks to scan for logs |
#### Mod Compatibility
| Option | Default | Description |
|--------|---------|-------------|
| Additional Dangerous Structures | `[]` | List of modded structure IDs to treat as dangerous |
| Additional Safe Structures | `[]` | List of modded structure IDs to treat as safe |
## How It Works
### Spawn Calculation
For each mob spawn attempt, the mod:
1. **Detects the environment** at the spawn location (not the player's location):
- Is the spawn position in a cave? What's the depth?
- How dense is the forest at that position? (counts nearby log blocks)
- Is the spawn position in a dangerous structure?
2. **Calculates multipliers**:
- Starts with the base multiplier
- Calculates cave multiplier (if in cave)
- Calculates forest multiplier (if logs detected)
- Selects the **highest** of: base, cave, or forest
3. **Applies additional modifiers**:
- Multiplies by structure multiplier (if in dangerous structure)
- Applies mob-specific rules (spiders, creepers)
4. **Makes the spawn decision**:
- All multipliers use probabilistic acceptance normalized to the highest configured multiplier
- The reference maximum is dynamically calculated from config (max of cave/forest/structure multipliers)
- Higher multipliers = higher acceptance probability = more spawns
- Examples (with default 5.0x reference from maxCaveMultiplier):
- 0.2x → 4% acceptance (very few spawns)
- 1.0x → 20% acceptance (reduced spawns)
- 3.0x → 60% acceptance (structures, many spawns)
- 5.0x → 100% acceptance (deep caves, maximum spawns)
- Multiplier = 0.0: Always denies spawn
### Performance
The mod is designed to be lightweight:
- **Cave detection**: Simple Y-coordinate check + sky visibility
- **Forest detection**: Cylindrical scan limited to ±3 blocks vertically
- **Structure detection**: Cached with 10-second TTL
- **Target impact**: