
无需铁门即可将村民拒之门外。 此模组允许你围绕房屋定义一个区域,阻止村民进入并迫使他们远离你的床和工作台。
交易、繁殖及其他所有功能均正常运行,只是不再在你的家门口发生。

金色粒子标记了本演示中的区域边界;游戏内计划添加轮廓线。
快速上手
- 安装 Fabric API 和 Eviction Notice。在单人游戏中,将两者都添加到你的游戏里。在服务器上,只需服务器端安装即可。
- 站在房屋的中央。
- 运行
/eviction set home 24
就这样。你现在拥有一个以你为中心、从世界底部延伸到顶部的 49×49 区域。
注意事项
- 新区域内的现有认领会被释放。 尚未与你交易过的村民会失去其职业,效果等同于破坏其工作台。已经与你交易过的村民则保留其工作。
- 区域是以你站立位置为中心的方形,并可选设置高度范围。
- 默认情况下,僵尸村民会被阻挡在外,而铁傀儡仍可正常进入。流浪商人及其羊驼也可被阻挡。所有这些行为均可在配置文件中更改。
此模组源于我在 Hardcore Forever World(极限生存永世世界)中遇到的烦恼。不知为何,整个村庄的村民决定寻路进入我家的一楼甚至阁楼,且无法劝离。

每个区域通过三种方式运作:
- 村民会绕行。 他们的寻路系统将区域视为障碍物,因此他们会绕过你的房子,而不是挤在门口。
- 他们无法在区域内进行认领。 区域内的床和工作台不会出现在村民寻找目标的列表中。在区域存在之前建立的认领会被释放,这样那些村民就不会再回来。
- 他们会被移出区域。 如果村民仍然处于区域内(例如因为在此生成或被推入),他们会被移动到区域外最近的安全点。系统不会将他们放置在岩浆上、屋顶上或已卸载的区块中。
你可以创建任意数量的区域,每个区域都有各自的名字、大小和高度范围。区域随世界保存,并归属于创建该区域的玩家。

| 命令 |
功能 |
/eviction set <name> <radius> [yMin] [yMax] |
创建一个以你为中心的区域 |
/eviction list |
列出你的区域 |
/eviction here |
显示你是否站在某个区域内 |
/eviction remove <name> |
删除一个区域 |
- 半径最大可达 256。省略
yMin 和 yMax 可覆盖全高度。
- 区域名称为单个单词(如
home、base_2),且不区分大小写。不能重复使用相同名称,因此需要先删除旧区域。
/eviction set home 24 创建的区域宽度为 49 格,而非 48 格,因为你脚下的方块也计入在内,创建区域时请留意这一点。
多人游戏与权限
- 每位玩家均可使用
/eviction 命令,无需管理员权限或额外许可。
- 每位玩家管理自己的区域。对玩家可拥有的区域数量没有限制。区域半径最大可达 256 格。
- 区域会阻挡所有村民,而不仅仅是所有者相关的村民,且没有任何机制阻止将区域放置在他人建筑之上。当有区域被创建或删除时,管理员会收到通知。
- 目前尚无管理员命令。若要移除其他玩家的区域,请停止服务器并编辑世界文件夹中的
eviction_notice/zones.json。
目前,Eviction Notice 最适合用于单人游戏、局域网以及由可信玩家组成的服务器。服务器控制功能正在规划中。

配置文件位于 config/eviction_notice.json。修改后需重启游戏或服务器。
| 选项 |
默认值 |
功能 |
evictionIntervalTicks |
20 |
每个区域的检查频率,单位为刻(20 刻 = 1 秒) |
mobs.zombieVillagers |
true |
同时阻挡僵尸村民 |
mobs.ironGolems |
false |
同时阻挡铁傀儡 |
mobs.wanderingTraders.enabled |
false |
同时阻挡流浪商人 |
mobs.wanderingTraders.llamas |
true |
同时阻挡商人的羊驼。仅在 enabled 开启时生效 |
来自 1.2.0 或更早版本的配置文件会在游戏或服务器启动时自动转换为当前格式,并保留你的设置。如果文件无法读取(例如由于拼写错误),模组将使用默认设置并保持文件原样,以便你进行修复。

- 仅服务端运行。 它在单人游戏、局域网和专用服务器上的表现一致。加入服务器的玩家无需安装任何内容。
- 安全添加到现有世界。 区域仅在你创建的地方影响村民。
- 安全移除。 村民的进出行为恢复如初。你的区域仍保存在世界文件夹的
eviction_notice/zones.json 中,因此如果你重新安装模组,它们依然存在。
- 与其他模组兼容。 它仅改变村民的寻路逻辑以及如何寻找床和工作台,且绝不会移除或替换实体。只有那些同样修改这些内容的模组才可能产生冲突。我本人已在包含 65 多个模组的整合包中正常使用,未遇到问题。
- 整合包: 欢迎将其纳入整合包。并请告知我,以便我去查看!

该模组会改变村民的路径寻找机制,使得区域(zone)内的方块被视为不可到达。它会过滤村民用于寻找床和工作站的搜索范围,确保区域内的方块永远不会被选中。此外,系统会定期检查并将任何仍停留在区域内的村民移动到最近的安全外部位置。区域通过区块(chunk)进行查找,因此即使存在大量区域,判断某个位置是否属于区域的操作依然高效且开销低廉。
Bug 与想法
发现了 Bug、遇到了崩溃或有新点子?请前往 问题追踪器 提交反馈。对于 Bug 报告,请附上你的游戏版本、模组列表以及 logs/latest.log 文件。

Keep villagers out of your house without iron doors. This mod lets you define a zone around your house that keeps villagers away and forces them to leave your beds and workstations alone.
Trading, breeding and everything else keeps working normally, just not on your doorstep.

The gold particles mark the zone edge for this clip; an in-game outline is planned.
Quick start
- Install Fabric API and Eviction Notice. In singleplayer, add both to your game. On a server, only the server needs them.
- Stand in the middle of your house.
- Run
/eviction set home 24
That's it. You now have a 49×49 zone around you that goes from the bottom of the world to the top.
Good to know
- Existing claims inside a new zone are released. A villager you haven't traded with yet loses its profession, the same as when you break its workstation. Villagers you've already traded with keep their job.
- Zones are squares centred on where you stand, with an optional height range.
- By default, zombie villagers are kept out and iron golems can still walk in. Wandering traders and their llamas can be kept out too. All of this can be changed in the config.
This mod was born out of annoyance in my Hardcore Forever World. Somehow the entire village decided to pathfind into the first floor and even the attic of my home and couldn't be convinced to leave.

Each zone works in three ways:
- Villagers walk around it. Their pathfinding treats the zone as blocked, so they go around your house instead of crowding at your door.
- They can't claim anything inside. Beds and workstations in a zone don't show up when villagers look for one. Claims from before the zone existed are released, so those villagers don't keep coming back.
- They get moved out. If a villager still ends up inside, for example because it spawned there or got pushed in, it's moved to the nearest safe spot outside your zones. It won't be put on lava, on your roof or into unloaded chunks.
You can make as many zones as you like, each with its own name, size and height range. Zones are saved with your world and belong to the player who made them.

| Command |
What it does |
/eviction set <name> <radius> [yMin] [yMax] |
Creates a zone centred on you |
/eviction list |
Lists your zones |
/eviction here |
Shows if you're standing in one of your zones |
/eviction remove <name> |
Deletes a zone |
- The radius goes up to 256. Leave out
yMin and yMax to cover the full height.
- Zone names are one word (
home, base_2) and aren't case-sensitive. You can't use the same name twice, so you need to remove the old zone first.
/eviction set home 24 makes a zone 49 blocks wide, not 48, because the block you're standing on counts too, keep that in mind when creating a zone.
Multiplayer and permissions
- Every player can use
/eviction without operator rights or extra permissions.
- Each player manages their own zones. There's no limit on how many zones a player can have. Zones can have a radius of up to 256 blocks.
- Zones keep out all villagers, not just the owner's, and nothing stops a zone being placed over someone else's build. Operators are told when a zone is created or removed.
- There are no admin commands yet. To remove another player's zone, stop the server and edit
eviction_notice/zones.json in the world folder.
Right now Eviction Notice is best suited to singleplayer, LAN and servers with players you trust. Server controls are planned.

The config is at config/eviction_notice.json. Restart the game or server after changing it.
| Option |
Default |
What it does |
evictionIntervalTicks |
20 |
How often each zone is checked, in ticks (20 ticks = 1 second) |
mobs.zombieVillagers |
true |
Keeps zombie villagers out as well |
mobs.ironGolems |
false |
Keeps iron golems out as well |
mobs.wanderingTraders.enabled |
false |
Keeps wandering traders out as well |
mobs.wanderingTraders.llamas |
true |
Keeps their trader llamas out too. Only works while enabled is on |
Config files from 1.2.0 or older are converted to this layout when the game or server starts, and your settings are kept. If the file can't be read, for example because of a typo, the mod uses the defaults and leaves the file alone so you can fix it.

- Server-side only. It works the same in singleplayer, LAN and on dedicated servers. Players joining a server don't need to install anything.
- Safe to add to an existing world. Zones only affect villagers where you make them.
- Safe to remove. Villagers come and go as before. Your zones stay in
eviction_notice/zones.json in the world folder, so they're back if you install the mod again.
- Works with other mods. It only changes villager pathfinding and how villagers find beds and workstations, and it never removes or replaces entities. Only mods that change those same things are likely to conflict. I run it alongside 65+ other mods without issues.
- Modpacks: Feel free to include it in modpacks. And let me know, so I can check it out!

The mod changes villager pathfinding so the blocks inside a zone count as unreachable. It filters the search villagers use to find beds and workstations, so the ones inside a zone are never found. A regular check moves any villager that is still inside to the nearest safe spot outside. Zones are looked up by chunk, so checking whether a spot is in a zone stays cheap even with many zones.
Bugs and ideas
Found a bug, had a crash or have an idea? Use the issue tracker. For bugs, please include your versions, your mod list and logs/latest.log.
评论 0
登录后参与评分
还没有评论,来抢沙发吧