CropXp 为农耕提供奖励:收获成熟的作物时,有一定概率掉落若干经验球。哪些作物计入、获得多少经验以及掉落概率均可由你自行配置。
✨ 亮点
- ? 收获作物可获得经验,数量和概率均可配置
- ?️ 游戏内设置界面(通过 Mod Menu + Cloth Config)
- ? 可通过数据包文件添加、移除或调整任何作物的参数——非常适合整合包和服务器
- ? 可选的 LevelZ 支持——安装 LevelZ 后也可授予 LevelZ 农作经验
- ♻️ 执行
/reload 可即时应用更改;创造模式下的掉落需手动开启
? 兼容性
Fabric 1.19.2、1.20.1、1.21.1
必需: Fabric API
可选: Mod Menu + Cloth Config(游戏内设置)、LevelZ(LevelZ 经验)
⚙️ 配置
通过 Mod Menu → CropXp 在游戏内编辑设置,或直接编辑 config/cropxp.json 文件。这些是未被覆盖的作物所使用的全局默认值。从 1.x 版本升级配置文件会自动完成迁移。
{
"general": {
"enabled": true,
"dropInCreative": false,
"defaults": { "min": 1, "max": 2, "chance": 0.5 }
},
"levelz": {
"enabled": true,
"defaults": { "min": 1, "max": 1, "chance": 0.25 }
}
}
| 设置项 |
默认值 |
含义 |
general.enabled |
true |
原版经验掉落的总开关。 |
general.dropInCreative |
false |
如果为 true,在创造模式下也会掉落经验。 |
general.defaults.min / max |
1 / 2 |
原版经验数量;会在 min 和 max 之间均匀随机抽取一个整数。 |
general.defaults.chance |
0.5 |
每次收获掉落原版经验的概率(0.0–1.0)。0 = 永不掉落,1 = 必定掉落。 |
levelz.enabled |
true |
LevelZ 经验掉落的开关(仅在安装了 LevelZ 时生效)。 |
levelz.defaults.min / max |
1 / 1 |
LevelZ 经验数量范围。 |
levelz.defaults.chance |
0.25 |
每次收获掉落 LevelZ 经验的概率。该判定独立于原版经验进行。 |
? 自定义作物(数据包)
每种被识别的作物都是一个 JSON 文件,因此你可以添加、调整或禁用任何作物——包括模组添加的作物——而无需修改模组本身。将文件放置于数据包的以下路径中:
data/<namespace>/cropxp/crops/<name>.json
<namespace> 可以是任意名称(建议使用你的数据包名称);cropxp/crops 是 CropXp 扫描的固定文件夹。将数据包放入世界的 datapacks/ 文件夹中,或在模组内打包分发。编辑后运行 /reload —— 配置界面中的“已识别作物”选项卡会列出当前加载的所有内容。
| 字段 |
类型 |
必填 |
描述 |
block |
string |
✅ |
方块 ID,例如 minecraft:carrots。 |
conditions |
object |
— |
必须全部匹配的状态值才能掉落经验,例如 { "age": 7 }。省略则匹配任意状态。 |
vanilla |
object |
— |
原版经验覆盖配置 { min, max, chance }。省略任何字段则回退到全局默认值。 |
levelz |
object |
— |
LevelZ 经验覆盖配置 { min, max, chance }。 |
requiresCorrectTool |
boolean |
— |
如果为 true,仅在使用正确工具破坏方块时才掉落经验。 |
enabled |
boolean |
— |
设置为 false 以关闭某种作物(例如禁用内置作物)。 |
Conditions 使用方块自身的状态属性——例如 age(小麦为 0–7,下界疣为 0–3),或 half(lower / upper)。只有与所有列出的条件相匹配的状态才会授予经验,因此未成熟的作物会被跳过。
示例
成熟胡萝卜并自定义经验:
{
"block": "minecraft:carrots",
"conditions": { "age": 7 },
"vanilla": { "min": 1, "max": 3, "chance": 0.6 }
}
完全成熟的下界疣,同时覆盖原版和 LevelZ 经验:
{
"block": "minecraft:nether_wart",
"conditions": { "age": 3 },
"vanilla": { "min": 2, "max": 4, "chance": 1.0 },
"levelz": { "min": 1, "max": 2, "chance": 0.5 }
}
关闭内置作物:
{ "block": "minecraft:cocoa", "enabled": false }
对于模组添加的作物也适用相同的模式——使用模组方块的 ID 及其自身的生长属性作为 conditions。
? 内置作物
小麦、胡萝卜、马铃薯、甜菜根、下界疣、可可、西瓜与南瓜藤蔓(包括附生藤蔓状态),以及 pitcher crop(在该方块存在的情况下)。
西瓜/南瓜块和火炬花被有意排除——因为它们会再生或可以被重新放置,这会导致无限获取经验。
最初是为我的个人整合包开发,现在分享给所有人。 ?
CropXp rewards farming: harvest a mature crop and there's a chance it
drops a few experience orbs. Which crops count, how much XP, and the drop
chance are all yours to configure.
✨ Highlights
- ? XP for harvesting crops, with configurable amount and chance
- ?️ In-game settings screen (via Mod Menu + Cloth Config)
- ? Add, remove, or retune any crop with data pack files — great for modpacks and servers
- ? Optional LevelZ support — also grants LevelZ farming XP when LevelZ is installed
- ♻️
/reload applies changes instantly; Creative mode is opt-in
? Compatibility
Fabric 1.19.2, 1.20.1, 1.21.1
Required: Fabric API
Optional: Mod Menu + Cloth Config (in-game settings), LevelZ (LevelZ XP)
⚙️ Configuration
Edit the settings in-game via Mod Menu → CropXp, or edit config/cropxp.json
directly. These are the global defaults used by every crop that doesn't
override them. Upgrading from a 1.x config is automatic.
{
"general": {
"enabled": true,
"dropInCreative": false,
"defaults": { "min": 1, "max": 2, "chance": 0.5 }
},
"levelz": {
"enabled": true,
"defaults": { "min": 1, "max": 1, "chance": 0.25 }
}
}
| Setting |
Default |
Meaning |
general.enabled |
true |
Master switch for vanilla XP drops. |
general.dropInCreative |
false |
If true, XP also drops while in Creative mode. |
general.defaults.min / max |
1 / 2 |
Vanilla XP amount; a whole number is rolled evenly between min and max. |
general.defaults.chance |
0.5 |
Chance per harvest to drop vanilla XP (0.0–1.0). 0 = never, 1 = always. |
levelz.enabled |
true |
Switch for LevelZ XP (only matters when LevelZ is installed). |
levelz.defaults.min / max |
1 / 1 |
LevelZ XP amount range. |
levelz.defaults.chance |
0.25 |
Chance per harvest to drop LevelZ XP. Rolled independently of vanilla XP. |
? Custom crops (data packs)
Every recognized crop is a JSON file, so you can add, retune, or disable any
crop — including modded ones — without changing the mod. Place files in a data
pack at:
data/<namespace>/cropxp/crops/<name>.json
<namespace> can be anything (use your pack's name); cropxp/crops is the
fixed folder CropXp scans. Put the pack in a world's datapacks/ folder or ship
it inside a mod. Run /reload after editing — the Recognized Crops tab in
the config screen lists everything currently loaded.
| Field |
Type |
Required |
Description |
block |
string |
✅ |
Block id, e.g. minecraft:carrots. |
conditions |
object |
— |
Block-state values that must all match for XP to drop, e.g. { "age": 7 }. Omit to match any state. |
vanilla |
object |
— |
Vanilla XP override { min, max, chance }. Any field omitted falls back to the global default. |
levelz |
object |
— |
LevelZ XP override { min, max, chance }. |
requiresCorrectTool |
boolean |
— |
If true, XP only drops when the block is broken with the correct tool. |
enabled |
boolean |
— |
Set false to turn a crop off (e.g. to disable a built-in one). |
Conditions use the block's own state properties — for example age (0–7
for wheat, 0–3 for nether wart), or half (lower / upper). Only states
that match every listed condition grant XP, so unripe crops are skipped.
Examples
Mature carrots with custom XP:
{
"block": "minecraft:carrots",
"conditions": { "age": 7 },
"vanilla": { "min": 1, "max": 3, "chance": 0.6 }
}
Fully-grown nether wart, overriding both vanilla and LevelZ XP:
{
"block": "minecraft:nether_wart",
"conditions": { "age": 3 },
"vanilla": { "min": 2, "max": 4, "chance": 1.0 },
"levelz": { "min": 1, "max": 2, "chance": 0.5 }
}
Turn off a built-in crop:
{ "block": "minecraft:cocoa", "enabled": false }
The same pattern works for modded crops — use the modded block id and its own
growth property in conditions.
? Built-in crops
Wheat, carrots, potatoes, beetroots, nether wart, cocoa, melon & pumpkin stems
(including the attached-stem state), and pitcher crop (where that block exists).
Melon/pumpkin blocks and torchflower are excluded on purpose — they regrow or
can be re-placed, which would allow infinite XP.
Originally built for my own modpack, now shared for everyone. ?
评论 0
登录后参与评分
还没有评论,来抢沙发吧