跳到正文

Real Mob Filter

作者:Jahus

Functional server-side filter for natural spawns, per entity type.

收藏

介绍

中文介绍正在准备中,下面暂时显示原文。

Real Mob Filter

Server-side filter for natural spawns, per entity type.

No Fabric API, no commands. No /reload, restart after editing.

Works for any entity, vanilla or not, as long as the spawn goes through the natural spawner (NaturalSpawner).

Config

config/realmobfilter.json (written on first launch)

enabled defaults to false. While it stays false, the filter does nothing.

{
  "enabled": false,
  "entities": {
    "minecraft:phantom": 0.0,
    "minecraft:creeper": 0.25
  }
}

The value is the chance to allow the natural spawn. The roll is uniform in [0, 1).

Value Effect
0.0 the attempt is cancelled every time
0.1 allowed 10% of the time, cancelled 90%
1.0 always allowed
missing key always allowed

An invalid id is ignored. A value outside [0, 1] is clamped.

Mobcap

Cancellation happens after Vanilla has picked the type. The attempt is not replaced and there is no second roll.

The mobcap therefore fills more slowly, but it still fills: only with rolls that pass, plus anything that is not in the config.

ToDo

Make the filter point configurable:

  • after (current): Vanilla picks, we cancel. Throughput drops.
  • before: remove or reweight the type in the biome list, before the roll. Throughput stays at the mobcap rate; only the mix changes.

However, not now; plenty of mods already rewrite that list. Feel free to test and submit a PR.

Where it cuts

Mixin on NaturalSpawner.getMobForSpawn, at the head of the method, before EntityType.create.

Vanilla already does if (mob == null) return;, so the attempt stops before the entity is created, before the collision test, and before finalizeSpawn.

Eggs, spawners, trial spawners, commands and bosses do not go through this method.

Compatibility

常见问题

Real Mob Filter 支持哪些 Minecraft 版本?

Real Mob Filter 支持 Minecraft Java 版 26.3,可用的加载器:Fabric / Forge / NeoForge。下载时注意选择和你游戏版本一致的文件。

Real Mob Filter 怎么安装?

先用 PCL2 或 HMCL 启动器安装对应版本的 Fabric / Forge / NeoForge,再把下载的 .jar 文件放进游戏目录的 mods 文件夹,重新启动游戏即可。开启了版本隔离的,mods 文件夹在 versions/版本名 下面。

评论

登录后评论和评分

Jahus 的其他作品

查看全部 →