村民农场
适用于 Minecraft 1.21.11 的 Fabric 模组,全面重构了村民的农耕行为。
功能特性
- 与
mob_griefing 解耦 —— 村民的收割、重新种植和拾取现在无视全局 mob_griefing 游戏规则(可在配置中切换)。设置 mob_griefing=false 可阻止苦力怕/末影人破坏世界,同时让村民继续耕作。
- 原子化收割 + 重新种植 —— 当农夫村民摧毁成熟作物时,种子会在同一刻被放回原位。产量为原版掉落物减去一个种子等价物。
- 五种扩展作物 —— 甘蔗、下界疣、南瓜、西瓜和可可豆。南瓜和西瓜仅在茎部生长时被收割(通过 blockorigin 验证),从而保护玩家放置的装饰物。甘蔗收割会保留底部 stalk,使整列重新生长。每种作物均可独立开关。
- 食物共享 + 繁殖集成 —— 南瓜(默认食物值=4)、西瓜片 / 甘蔗 / 可可豆(食物值=1)均计入村民繁殖准备度。自定义共享路径允许农夫村民在拥有 ≥2 个单位时立即将其投掷给邻居,从而使新作物真正流通起来。
- 拾取状态效果 —— 拾取甘蔗获得速度效果(持续时间 + 增强等级可按每根甘蔗配置)。可可豆获得再生效果。牧师村民拾取下界疣时会随机获得一种配置的正向效果。
- 农夫防踩踏 —— 具有农夫职业的村民不再因跳跃而毁坏自己的耕地。其他实体仍正常造成踩踏。
- 更宽范围的 AI 扫描 —— 原版农夫大脑仅扫描村民周围 ±1 的范围。本模组添加了可配置的更宽范围扫描以支持扩展作物(默认 ±2)。包含一个回退机制,用于填充
SECONDARY_JOB_SITE 以支持灵魂沙和丛林原木农场;若无此机制,大脑框架甚至不会考虑执行农耕任务。
- WTHIT + Jade 工具提示集成 —— 悬停在村民身上会显示其当前活动状态(工作中 / 休息中 / 会面中 / 空闲中等)及其物品栏内容。可选功能;支持 WTHIT 或 Jade 任意一种工具提示模组,或不安装任何此类模组也可工作。
每项功能均有配置开关,每个魔法数字均可编辑。
安装指南
- 安装 Fabric Loader ≥ 0.19.2 和 Fabric API,版本需对应 Minecraft 1.21.11。
- 下载
blockorigin(必需运行时依赖 —— 提供原因追踪功能,使茎部生长的南瓜/西瓜检测得以生效)。
- 从 发布页面 下载
villagerfarm-x.y.z.jar,并将其放入 mods/ 文件夹中与 blockorigin 并列放置。
- 可选:安装 WTHIT 或 Jade 以获得村民工具提示覆盖层。
配置说明
首次启动时,模组会创建 config/villagerfarm.json 文件并填入合理的默认值。编辑该文件后必须重启游戏/服务器以使更改生效。不支持热重载命令。
模式结构为一个包含两个顶级部分的 JSON 对象:
features — 开关项
| 键名 |
默认值 |
效果 |
gamerule_split |
true |
当为 true 时,村民农耕与拾取将无视原版的 mob_griefing 游戏规则。设为 false 则恢复为原版耦合行为。 |
atomic_harvest_replant |
true |
原版小麦/甜菜/土豆/胡萝卜在同一刻完成收获与重新种植。禁用此项以恢复原版两步行为。 |
anti_trample |
true |
具有农夫职业的村民不会因跳跃而踩踏耕地。 |
secondary_job_site_patcher |
true |
强制靠近灵魂沙 / 丛林原木 / 等的农夫村民考虑 FarmerVillagerTask。若无此项,原版大脑框架拒绝为非耕地农场运行该任务。 |
tooltip_integration |
true |
WTHIT/Jade 村民工具提示将显示活动状态及物品栏内容。 |
extended_crops.enabled |
true |
五种额外作物的总开关。 |
extended_crops.sugar_cane / nether_wart / cocoa / pumpkin / melon |
true |
按作物分类的开关,嵌套在主开关之下。 |
food_sharing.enabled |
true |
自定义低阈值共享路径的总开关。 |
food_sharing.share_pumpkin / share_melon_slice / share_sugar_cane / share_cocoa_beans / share_nether_wart_to_cleric |
true |
按物品分类的共享开关。当下界疣的开关开启时,仅农夫→牧师之间进行共享。 |
pickup_effects.sugar_cane.enabled |
true |
拾取甘蔗时的效果启用开关。 |
pickup_effects.sugar_cane.effect |
"minecraft:speed" |
随机获取的状态效果标识符。支持任何原版或模组添加的效果 ID。 |
pickup_effects.sugar_cane.ticks_per_item |
200 |
每根甘蔗增加的刻度数(20t/s,因此 200 = 10秒)。 |
pickup_effects.sugar_cane.amplifier |
0 |
0 = I 级,1 = II 级,以此类推。 |
pickup_effects.cocoa_beans.* |
true / "minecraft:regeneration" / 100 / 0 |
结构与甘蔗相同,默认为每颗可可豆 5 秒的再生效果。 |
pickup_effects.nether_wart.enabled |
true |
拾取下界疣时随机获得正向效果。 |
pickup_effects.nether_wart.cleric_only |
true |
仅对牧师村民触发。 |
pickup_effects.nether_wart.duration_ticks |
600 |
30 秒(20 t/s)。 |
pickup_effects.nether_wart.amplifier |
0 |
效果等级。 |
pickup_effects.nether_wart.allowed_effects |
11 项条目 |
从中随机抽取的标识符列表。错误的 ID 将被静默丢弃。 |
values — 数值调节项
| 键 |
默认值 |
效果 |
food_values |
pumpkin=4, melon_slice=1, sugar_cane=1, cocoa_beans=1 |
minecraft:item_id → 食物值的映射表。未在此映射中的物品不会被村民视为食物。 |
search.extended_radius_xyz |
2 |
扩展作物的外层搜索范围(原版为 1)。 |
search.extended_harvest_distance_squared |
16.0 |
村民可收割扩展作物的最大平方距离。 |
search.unstuck_min/max_distance_squared |
1.0 / 6.25 |
在此平方距离范围内的原版 CropBlock 目标会触发“脱困”收割逻辑,以防止大脑锁定无法触及的小麦。 |
search.secondary_job_site_radius_xz / radius_y / tick_interval |
4 / 2 / 40 |
补丁扫描的维度尺寸和刷新间隔(以刻为单位)。 |
sharing.min_stack_size_to_toss |
2 |
农夫至少需要持有此数量的物品才会将其抛给邻居。 |
sharing.max_share_distance_squared |
5.0 |
自定义分享路径中,农夫与目标村民之间的最大平方距离。 |
配置文件不会对其输入进行验证。如果你设置 ticks_per_item: -50 或将 enabled 重命名为 enabled_lol,你将得到 Gson 决定的任何回退值——通常是缺失字段的默认值,或是对无意义值的怪异行为。请负责任地编辑。
是的,它由 Claude 制作
Villager Farm
A Fabric mod for Minecraft 1.21.11 that overhauls villager farming behavior.
Features
- Decoupled from
mob_griefing — villager harvest, replant, and pickup now ignore the global mob_griefing gamerule (toggle in config). Set mob_griefing=false to stop creepers/endermen damaging the world while villagers keep farming.
- Atomic harvest + replant — when a farmer breaks a mature crop, the seedling goes back in the same tick. Yields are vanilla loot minus one seed-equivalent.
- Five extended crops — sugar cane, nether wart, pumpkin, melon, and cocoa. Pumpkins and melons are only harvested when stem-grown (verified via blockorigin) so player-placed decorations are left alone. Sugar cane harvest leaves the bottom stalk so the column regrows. Each crop is independently toggleable.
- Food sharing + breeding integration — pumpkin (food=4 by default), melon slice / sugar cane / cocoa beans (food=1) all count toward villager breeding readiness. Custom share path lets farmers throw any of these to neighbors as soon as they have ≥2 in a slot, so the new crops actually circulate.
- Pickup status effects — picking up sugar cane gives Speed (configurable duration + amplifier per cane). Cocoa beans give Regeneration. A cleric picking up nether wart rolls one of the configured positive effects.
- Farmer anti-trample — farmer-profession villagers stop wrecking their own farmland by jumping. Other entities still trample normally.
- Wider AI scan — vanilla's farmer brain only scans ±1 around the villager. The mod adds a configurable wider scan for extended crops (default ±2). Includes a fallback that populates
SECONDARY_JOB_SITE for soul-sand and jungle-log farms; without it, the brain framework would refuse to even consider the farming task.
- WTHIT + Jade tooltip integration — hovering a villager shows their current activity (Working / Resting / Meeting / Idle / etc.) plus their inventory contents. Optional; works with either tooltip mod, or none.
Every feature has a config toggle, and every magic number is editable.
Installation
- Install Fabric Loader ≥ 0.19.2 and Fabric API for Minecraft 1.21.11.
- Download
blockorigin (required runtime dep — provides the cause-tracking that makes the stem-grown pumpkin/melon detection work).
- Download
villagerfarm-x.y.z.jar from the releases page and drop it into your mods/ folder alongside blockorigin.
- Optional: install WTHIT or Jade to get the villager tooltip overlay.
Configuration
On first launch the mod creates config/villagerfarm.json with sensible defaults. Edit the file and restart the game/server to apply changes. There's no hot-reload command.
The schema is a single JSON object with two top-level sections:
features — toggles
| Key |
Default |
Effect |
gamerule_split |
true |
When true, villager farming + pickup ignore vanilla's mob_griefing gamerule. Set false to revert to vanilla coupling. |
atomic_harvest_replant |
true |
Vanilla wheat/beetroot/potato/carrot harvested + replanted in the same tick. Disable for vanilla two-step behavior. |
anti_trample |
true |
Farmer-profession villagers don't trample farmland by jumping. |
secondary_job_site_patcher |
true |
Forces farmers near soul-sand / jungle-log / etc. to consider the FarmerVillagerTask. Without this, vanilla brain refuses to run the task for non-farmland farms. |
tooltip_integration |
true |
WTHIT/Jade villager tooltip displays activity + inventory. |
extended_crops.enabled |
true |
Master switch for the five extra crops. |
extended_crops.sugar_cane / nether_wart / cocoa / pumpkin / melon |
true |
Per-crop toggles, layered under the master switch. |
food_sharing.enabled |
true |
Master switch for the custom low-threshold share path. |
food_sharing.share_pumpkin / share_melon_slice / share_sugar_cane / share_cocoa_beans / share_nether_wart_to_cleric |
true |
Per-item share toggles. Wart is farmer→cleric only when its toggle is on. |
pickup_effects.sugar_cane.enabled |
true |
Effect on sugar-cane pickup. |
pickup_effects.sugar_cane.effect |
"minecraft:speed" |
Status effect identifier rolled. Any vanilla/modded effect id works. |
pickup_effects.sugar_cane.ticks_per_item |
200 |
Ticks added per cane (20t/s, so 200 = 10s). |
pickup_effects.sugar_cane.amplifier |
0 |
0 = level I, 1 = level II, etc. |
pickup_effects.cocoa_beans.* |
true / "minecraft:regeneration" / 100 / 0 |
Same shape as sugar cane, 5s/bean of Regen by default. |
pickup_effects.nether_wart.enabled |
true |
Random positive effect on nether-wart pickup. |
pickup_effects.nether_wart.cleric_only |
true |
Only fires for cleric villagers. |
pickup_effects.nether_wart.duration_ticks |
600 |
30 seconds at 20 t/s. |
pickup_effects.nether_wart.amplifier |
0 |
Effect level. |
pickup_effects.nether_wart.allowed_effects |
11 entries |
Identifier list rolled from. Bad ids are silently dropped. |
values — numeric knobs
| Key |
Default |
Effect |
food_values |
pumpkin=4, melon_slice=1, sugar_cane=1, cocoa_beans=1 |
Map of minecraft:item_id → food points. Items not in this map are not villager food. |
search.extended_radius_xyz |
2 |
The outer search shell for extended crops (vanilla is 1). |
search.extended_harvest_distance_squared |
16.0 |
Max squared distance the villager will harvest an extended crop from. |
search.unstuck_min/max_distance_squared |
1.0 / 6.25 |
Vanilla CropBlock targets in this squared-distance window get an unstuck-harvest so the brain doesn't lock onto unreachable wheat. |
search.secondary_job_site_radius_xz / radius_y / tick_interval |
4 / 2 / 40 |
Patcher scan dimensions and refresh interval (ticks). |
sharing.min_stack_size_to_toss |
2 |
Farmer needs at least this count in a slot to toss it to a neighbor. |
sharing.max_share_distance_squared |
5.0 |
Max squared distance between farmer and target villager for the custom share path. |
The config does not validate its inputs. If you set ticks_per_item: -50 or rename enabled to enabled_lol, you get whatever fallback Gson decides — usually defaults for missing fields, weird behavior for nonsense values. Edit responsibly.
yes its made by claude
评论 0
登录后参与评分
还没有评论,来抢沙发吧