No Crop Trample
一款只做一件事的小模组:防止农田在被实体踩踏后 revert 为泥土。不再因为一个不小心的跳跃、游荡的僵尸或一支乱飞的箭而毁掉你的麦田。
适用于 Fabric 和 NeoForge 平台上的 Minecraft 26.1.x。
为什么制作这个模组
Minecraft 26.1 是全新版本,那些流行的旧版防踩踏模组尚未移植。本模组填补了这一空白,提供一个极简且加载快速的实现方案——不添加新方块、不添加新物品,仅修复该问题。
功能说明
- 默认禁用所有实体的农田踩踏行为——包括玩家、怪物和投射物。
- 提供一个简单的 JSON 配置开关,如果你希望关闭此功能可自行调整。
- 摔落伤害仍然正常生效。仅跳过导致农田破坏的逻辑路径。
底层原理
- Fabric:通过一个微小的 mixin 包裹
FarmlandBlock.fallOn中的turnToDirt(...)调用,使用 MixinExtras 的@WrapOperation(随 Fabric Loader 捆绑提供,无需额外依赖)。 - NeoForge:订阅内置的
BlockEvent.FarmlandTrampleEvent事件并取消它。
两条路径都经过同一个受配置影响的决策流程,因此未来可以在不破坏兼容性的前提下,按实体类型添加切换选项(如仅玩家、仅怪物、仅投射物)。
配置
编辑 config/nocroptramplelite.json(首次启动时自动生成):
{
"preventTrampling": true
}
| 键名 | 默认值 | 说明 |
|---|---|---|
preventTrampling |
true |
设为 true 时,任何实体都无法踩踏农田。设为 false 可恢复原版行为。 |
修改配置后需重启 Minecraft(或专用服务器)以使更改生效。
与模组农作物的兼容性
自动支持以下情况:
- 种植在原版农田上的模组农作物——最常见场景(如 Farmer's Delight、大多数魔法作物模组等)。
- 继承自原版
FarmlandBlock的模组农田——保护机制通过继承自然生效。 - 重写
fallOn但调用super.fallOn(...)的模组农田——super 调用会重新进入受保护的路径。
不影响以下情况:
- 完全替换
fallOn并自带独立踩踏逻辑的模组农田(较少见)。 - 完全不继承
FarmlandBlock的自定义“农田”方块。 - 盆栽式种植器(Botany Pots、Garden Cloches 等)——它们本身就不存在踩踏问题。
要求
- Minecraft 26.1.x
- Java 25
- Fabric Loader 0.18.4+ 并安装 Fabric API,或 NeoForge 26.1+
许可证
CC0-1.0 — 公有领域,你可以随意使用它。
源码
No Crop Trample
A small mod that does one thing: stops farmland from reverting to dirt when entities land on it. No more destroyed wheat fields from a careless jump, a wandering zombie, or a stray arrow.
Targets Minecraft 26.1.x on both Fabric and NeoForge.
Why this mod exists
Minecraft 26.1 is brand new and the popular legacy trample-prevention mods haven't ported yet. This fills the gap with a minimal, fast-loading implementation — no new blocks, no new items, just the fix.
What it does
- Disables farmland trampling for all entities by default — players, mobs, projectiles.
- One simple JSON config toggle if you want to turn it off.
- Fall damage still applies. Only the farmland-destruction path is skipped.
How it works under the hood
- Fabric: a tiny mixin wraps the
turnToDirt(...)call insideFarmlandBlock.fallOn, using MixinExtras'@WrapOperation(bundled with Fabric Loader, no extra dependency). - NeoForge: subscribes to the built-in
BlockEvent.FarmlandTrampleEventand cancels it.
Both paths route through the same config-aware decision, so per-entity-type toggles (player-only, mob-only, projectile-only) can be added in a future release without breaking changes.
Configuration
Edit config/nocroptramplelite.json (created on first launch):
{
"preventTrampling": true
}
| Key | Default | Notes |
|---|---|---|
preventTrampling |
true |
When true, no entity can trample farmland. Set false to restore vanilla behaviour. |
Restart Minecraft (or the dedicated server) after editing for changes to take effect.
Compatibility with modded crops
Works automatically with:
- Modded crops planted on vanilla farmland — most common case (Farmer's Delight, most magic-crop mods, etc.).
- Modded farmland that extends vanilla
FarmlandBlock— inheritance carries the protection through. - Modded farmland that overrides
fallOnbut callssuper.fallOn(...)— super call routes back into the protected path.
Does not affect:
- Modded farmland that fully replaces
fallOnwith its own trample logic (rare). - Custom "farmland" blocks that don't extend
FarmlandBlockat all. - Pot-style growers (Botany Pots, Garden Cloches, etc.) — they don't have trampling to begin with.
Requirements
- Minecraft 26.1.x
- Java 25
- Fabric Loader 0.18.4+ with Fabric API, or NeoForge 26.1+
License
CC0-1.0 — public domain, do whatever you want with it.
Source
下载 No Crop Trample
下载 No Crop Trample
下载 No Crop Trample
下载 No Crop Trample
下载 No Crop Trample
下载 No Crop Trample
下载 No Crop Trample
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 No Crop Trample
下载 No Crop Trample
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 No Crop Trample
更新内容
- 已适配 Minecraft 26.3(Fabric Loader 0.19.5+ / Fabric API 0.161.0+;NeoForge
26.3.0.7-beta+)。需要 Minecraft 26.3。
修复内容
- 将 Fabric 的耕地 mixin 移植到 26.3,在该版本中耕地被泛化为基础方块:原先拦截的静态方法
turnToDirt变为实例方法turnToBaseBlock。行为保持一致——践踏效果仍根据配置被取消。
注意事项
- NeoForge for 26.3 仍处于 测试版 状态;此构建版本针对
26.3.0.7-beta。 - 无配置或行为变更。
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
模组
缓冲的原始输入和线程化的事件轮询
模组
可定制的鞘翅模组,支持装饰纹饰、旗帜图案等更多功能!
模组
一个用于收集生物掉落物的多区块模组。
模组
显示你正在注视的方块的信息。(适用于 Minecraft 1.16+ 的 Hwyla/Waila 分支)
模组
原版世界生成优化模组
模组
在游戏画面角落显示附近世界地形、玩家、生物和实体的地图。可创建路径点,帮助你找到标记过的位置。
评论 0
登录后参与评分
还没有评论,来抢沙发吧