Перейти к содержимому
Mineforgian

Mob Limiter

Set per-chunk and world limits to manage mob spawning and prevent overcrowded farms.

Загрузки
23K
Подписчики
11
Обновлён
15 апреля 2025 г.
Лицензия
MIT

Опубликован 23 февраля 2025 г.

This mod lets you control mob spawning by setting per-chunk and world limits, helping to prevent overcrowded farms or excessive mob spawns.

Features

  • Chunk Limits: Restrict mob counts per chunk to avoid overcrowding.
  • World Limits: Set global caps for total mob populations.
  • Targeted Limits: Apply restrictions to specific mobs, categories, or namespaces.
  • Modded Mobs: Supports mobs registered in Forge.
  • Excess Handling: Remove excess mobs via silent despawn or kill with loot and experience.
  • Despawn Control: Choose vanilla rules, custom despawn ranges, or persistent mobs.
  • Commands:
    • /moblimiter reload: Refresh config without server restart.
    • /moblimiter info: Display active settings.
  • Priority System: Limits prioritize specific mobs, then categories, namespaces, and defaults.
  • Optimized: Asynchronous processing ensures smooth server performance.

Configuration

Customize limits and despawn behavior in config/moblimiter.json5. Example:

{
  // Vanilla despawn settings
  // mode: "vanilla" (default rules), "custom" (set min/max distance), "disabled" (persistent mobs)
  "vanilla_despawn": {
    "mode": "custom",
    "min_distance": 32.0, // Min distance (blocks) to despawn (for "custom" mode)
    "max_distance": 128.0 // Max distance (blocks) to despawn (for "custom" mode)
  },
  
  // World-wide mob limits
  // enabled: true/false to toggle world limits
  // total: Max mobs in the world (-1 for unlimited)
  // removal_type: "despawn" (silent) or "kill" (drops loot)
  "world_limits": {
    "enabled": true,
    "total": 500, // Total mobs allowed in the world
    "removal_type": "despawn",
    "mobs": {
      "minecraft:cow": 100, // Max 100 cows in the world
      "minecraft:pig": 100, // Max 100 pigs in the world
      "minecraft:zombie": 50 // Max 50 zombies in the world
    }
  },
  
  // Per-chunk mob limits
  // enabled: true/false to toggle chunk limits
  // default.limit: Default mob cap per chunk (-1 for unlimited)
  // removal_type: "despawn" (silent) or "kill" (drops loot)
  "chunk_limits": {
    "enabled": true,
    "removal_type": "despawn",
    "default": { "limit": 20 }, // Default limit for unspecified mobs
    "mobs": {
      "minecraft:cow": 10, // Max 10 cows per chunk
      "minecraft:pig": 10, // Max 10 pigs per chunk
      "minecraft:chicken": 10, // Max 10 chickens per chunk
      "minecraft:creatures": 15, // Max 15 creatures (animals) per chunk
      "minecraft:*": 8 // Max 8 of any other Minecraft mob per chunk
    }
  }
}

Usage

Follow these steps to set up and use Mob Limiter:

  1. Install the Mod:
    Add Mob Limiter to your server (client installation is optional). The mod is server-side and works without requiring clients to install it.

  2. Configure Limits:
    After launching the server, find config/moblimiter.json5 in the server directory. Edit the file to set your desired limits and despawn behavior (see the example above). Save the file after making changes.

  3. Apply Changes:
    Run /moblimiter reload in-game or via the server console to apply changes without restarting.

  4. Check Settings:
    Use /moblimiter info to view the current configuration, including despawn mode, world limits, and chunk limits.

Ченджлог

1.1.0Релиз1.20.1 · 15 апреля 2025 г.

Added

  • JSON5 Configuration: Replaced TOML with a more flexible JSON5 format.
  • World Limits: Added global mob caps for world-wide restrictions.
  • Vanilla Despawn Control: Introduced vanilla_despawn settings (vanilla, custom, disabled) to manage mob persistence.
  • Removal Types: Added removal_type (despawn for silent removal, kill for loot drops) for both world and chunk limits.
  • Priority System: Chunk limits now follow a clear priority: specific mob → category → namespace → default.
  • Asynchronous Processing: Mob limit checks and cache updates now run asynchronously.
  • Commands:
    • Added /moblimiter info to display current settings.
    • Removed /moblimit debug and /moblimit stats for a simpler command structure.

Changed

  • Config Structure: Reworked into world_limits, chunk_limits, and vanilla_despawn sections, with the ability to enable/disable each.
  • Default Removal: Set to despawn (previously removed silently) to avoid unintended loot drops.
  • Command Namespace: Updated from /moblimit to /moblimiter for consistency.

Fixed

  • ConcurrentModificationException: Resolved crash during mob removal in high-load scenarios.
  • Config Parsing: Improved error handling for invalid mob IDs and config formats.
  • Config Duplication: Fixed duplication of config file after reloading with /moblimiter reload.

Note

  • Existing TOML configs (moblimiter.toml) must be migrated to JSON5 (moblimiter.json5). Check the new config file for updated structure and examples.
1.0.0Релиз1.20.1 · 23 февраля 2025 г.

The initial release of the mod.

  • Support for individual mob limits via moblist.
  • Support for embedded groups (peaceful, hostile, all) via groups.
  • Support for user groups via custom_groups.
  • Added the commands /moblimit reload, /moblimit debug, and /moblimit stats.
  • Implemented basic spawn check and removal of unnecessary mobs via MobLimitChecker.

Комментарии

Загружаем…