Tags
Creators
Details
Licensed CC-BY-NC-4.0
Published last year
Updated 23 minutes ago
All versions
5.1.9-beta
Beta
Croparium 5.1.9-betayesterday 28
Compatibility
Minecraft: Java Edition
26.3
Platforms
Fabric
Quilt
Supported environments
Client and server
Required content
Any compatible version
Changes
New Content
General
Data Pack
Right-Click Harvest Mapping
- The drop mapping for right-click harvesting mature crops is now driven by data packs. The original hardcoded "mature crop block → harvest output" mapping table is no longer used as an extension configuration source.
- You can now use
custom_lootdata pack files to describe the target block, conditions, drop item, and count modifiers. - When right-click harvesting mature crops, the mod matches the registry ID of the right-clicked block against
target_blockin the file. The file only takes effect after a successful match. - Each entry in the
conditionsarray is an independent rule. It can be selected by array index, or looked up by text viacondition_id. - When a condition matches, one item is produced according to the corresponding
drop; each rule produces only one item. - All random rolls, enchantment level reads, and similar calculations are only performed after that condition has passed.
- Client-side calls do not perform any calculations and directly return air; this only takes effect on the server side.
- On parse or execution exceptions, fallback is applied by type: items return air, counts return
0, with a log warning attached. - The cache uses the file path as its key. Running
/reloadclears the cache.
JSON Format Overview
- The file top level must contain
type,target_block, andconditions. typemust becustom_loot. The type text on the mod side must exactly match it and is used to validate the file type.target_blockuses a block namespace ID, such asminecraft:stone. The mod matches the registry ID of the passed block against this field to determine whether the file takes effect.commentis an optional comment. The parser ignores it directly; it is only for data pack authors to read.conditionsis an array of condition rules. Each entry is an independent rule; an index input selects that array index.- A single condition consists of
condition_id,predicate, anddrop;predicateanddropare required. condition_idis optional and allows the mod to look up this rule by text. Matching is strict and exact, and case-sensitive.predicateis used to check whether the passed entity satisfies this rule; multiple predicate sub-entries are combined bylogic.dropdescribes the item configuration produced when the rule matches; it contains the item ID, base count, NBT/Item Component, and count modifiers.modifiersare executed in array order;modedetermines whether to add or set, andfunctiondetermines the count function.
Top-Level Fields
| Field | Type | Required | Description |
|---|---|---|---|
type |
string | Yes | Custom data pack type identifier. Must be custom_loot; the type text on the mod side must exactly match it and is used to validate the file type |
target_block |
string | Yes | Block namespace ID; the mod matches the registry ID of the passed block against this field to determine whether the file takes effect |
comment |
string | No | Comment text. The parser ignores it directly; it is only for data pack authors to read |
conditions |
array | Yes | Array of condition rules; each entry is an independent rule; an index input selects that array index |
conditions Single Condition
| Field | Type | Required | Description |
|---|---|---|---|
condition_id |
string | No | Unique condition identifier for the mod to look up this rule by text; case-sensitive, strict exact matching |
predicate |
object | Yes | Set of predicate rules used to check whether the passed entity satisfies this rule |
drop |
object | Yes | Item configuration produced when this rule matches; each rule produces only one item |
predicate Predicate Object
| Field | Type | Required | Description |
|---|---|---|---|
logic |
string | Yes | Logic between multiple predicate sub-entries; only AND / OR are supported |
enchantment_level |
object | No | Checks the specified enchantment level of the entity's mainhand item; returns 0 if not enchanted |
potion_effect_remaining |
object | No | Checks the remaining ticks of the specified potion effect on the entity; returns 0 if absent |
potion_effect_amplifier |
object | No | Checks the entity's potion amplifier level; Speed I is 0; returns -1 if absent |
mainhand_item |
object | No | Checks the entity's mainhand item registry ID string; returns minecraft:air for an empty hand |
offhand_item |
object | No | Checks the entity's offhand item registry ID string; returns minecraft:air for an empty hand |
- Predicate sub-entries uniformly use the
enchant/effect,op, andvaluefields. opsupports:==,!=,>,<,>=,<=.logiconly supportsAND/ORand is used to combine multiple predicate sub-entries.- Enchantment level: returns
0if not enchanted. - Potion remaining ticks: returns
0if the effect is absent. - Potion amplifier: returns
-1if the effect is absent. - Mainhand / offhand: returns
minecraft:airfor an empty hand.
drop Item Configuration
| Field | Type | Required | Description |
|---|---|---|---|
id |
string | Yes | Item namespace ID |
count |
int | No | Base count, the initial value before modifiers are executed; if omitted or in an invalid format, defaults to 1 |
nbt |
object | No | Additional item NBT / Item Component; an empty object means no additional data |
modifiers |
array | No | Array of count modifiers, executed in order; if omitted, count is used directly as the final count |
modifiersis an array and modifiers are executed in order.- If
modifiersis omitted, the final count directly usescount. - If
countis missing or in an invalid format, it is treated as1. nbtuses an empty object to indicate no additional data.
modifiers Single Modifier
| Field | Type | Required | Description |
|---|---|---|---|
mode |
string | Yes | Execution mode: add to add, set to overwrite the current count |
function |
string | Yes | Count function: uniform for uniform random, looting for simulated Looting enchantment |
min |
number / dynamic object | uniform only | Uniform distribution minimum; supports a fixed number or a dynamic enchantment object |
max |
number / dynamic object | uniform only | Uniform distribution maximum; supports a fixed number or a dynamic enchantment object, and can bind to mainhand / offhand enchantment level |
enchant |
string | looting only | Enchantment ID to read |
include_offhand |
boolean | looting only | Whether to add the offhand's level of that enchantment into the calculation |
modeset toadd: adds the value calculated by this function to the current calculated count.modeset toset: directly overwrites the current count with this function's result, ignoring any count calculated previously.uniformis a uniform distribution;minandmaxsupport fixed numbers or dynamic enchantment objects.- For
uniform, ifmin > max, outputs0. lootingsimulates Looting; the enchantment level is the value added this time, aligned with vanilla Looting logic.- For
looting, wheninclude_offhandistrue, the mainhand + offhand levels of that enchantment are added together; whenfalse, only the mainhand is used. - For
looting, if the enchantment does not exist or the corresponding hand is empty, that hand's enchantment level is treated as0. - If a modifier calculation result is less than
0, the final count is forcibly clamped to0.
Dynamic Enchantment Object
{
"type": "enchant_level",
"enchant": "minecraft:fortune",
"hand": "mainhand"
}
| Field | Type | Required | Description |
|---|---|---|---|
type |
string | Yes | Fixed as enchant_level |
enchant |
string | Yes | Enchantment ID |
hand |
string | Yes | mainhand / offhand; reads the enchantment level of the corresponding hand |
- Dynamic enchantment objects can be used for
uniform'smin/max. handcan bemainhand/offhand.- Reads the enchantment level of the corresponding hand; if not enchanted or the corresponding hand is empty, it is treated as
0.
Count Calculation and Boundary Rules
- The initial count comes from
drop.count; if missing or invalid, defaults to1. modifiersare executed in array order.addadds the function result to the current count.setdirectly overwrites the current count with the function result, ignoring any count calculated previously.uniformgenerates a uniform random value; ifmin > max, outputs0.lootingreads the specified enchantment level and uses it as the value added this time;include_offhandcontrols whether the offhand is added.- All random rolls and enchantment reads are only calculated after this condition has passed.
- If a modifier calculation result is less than
0, the final count is clamped to0. - A condition rule produces only one item.
Common Rules and Exception Handling
- Operators only support
==,!=,>,<,>=,<=. logiconly supportsAND/OR.- Only effective on the server side; client-side calls do not perform any calculation and directly return air /
0. - The cache key is the file path. Running
/reloadclears the cache. - All exceptions fall back: items return air, counts return
0, with a log warning attached. condition_iduses strict exact matching and is case-sensitive.typemust exactly match the input text and is used to validate the file type.target_blockmust match the passed block registry ID for the file to take effect.commentis ignored by the parser and does not participate in any logic.
JSON Examples
- Example 1: The
custom_lootJSON for the right-click drops of the raw copper crop in the Croparium mod.
{
"type": "crop_mapping",
"target_block": "cp_lib:copper_crop",
"comment": "Custom loot table for right-click drops of the raw copper crop in the Croparium mod",
"conditions": [
{
"condition_id": "with_fire_aspect",
"predicate": {
"logic": "AND",
"enchantment_level": {
"enchant": "minecraft:fire_aspect",
"op": ">",
"value": 0
}
},
"drop": {
"id": "minecraft:copper_ingot",
"count": 1,
"nbt": {},
"modifiers": [
{
"mode": "add",
"function": "looting",
"enchant": "minecraft:fortune",
"include_offhand": true
},
{
"mode": "add",
"function": "looting",
"enchant": "minecraft:looting",
"include_offhand": true
}
]
}
},
{
"condition_id": "without_fire_aspect",
"predicate": {
"logic": "AND",
"enchantment_level": {
"enchant": "minecraft:fire_aspect",
"op": "==",
"value": 0
}
},
"drop": {
"id": "minecraft:raw_copper",
"count": 1,
"nbt": {},
"modifiers": [
{
"mode": "add",
"function": "looting",
"enchant": "minecraft:fortune",
"include_offhand": true
},
{
"mode": "add",
"function": "looting",
"enchant": "minecraft:looting",
"include_offhand": true
}
]
}
}
]
}
- Example 2: The
custom_lootJSON for the right-click drops of the gunpowder crop in the Croparium mod.
{
"type": "crop_mapping",
"target_block": "cp_lib:gunpowder_crop",
"comment": "Custom loot table for right-click drops of the gunpowder crop in the Croparium mod",
"conditions": [
{
"condition_id": "with_fire_aspect",
"predicate": {
"logic": "AND",
"enchantment_level": {
"enchant": "minecraft:fire_aspect",
"op": ">",
"value": 0
}
},
"drop": {
"id": "minecraft:gunpowder",
"count": 1,
"nbt": {},
"modifiers": [
{
"mode": "add",
"function": "looting",
"enchant": "minecraft:fortune",
"include_offhand": true
},
{
"mode": "add",
"function": "looting",
"enchant": "minecraft:looting",
"include_offhand": true
}
]
}
},
{
"condition_id": "without_fire_aspect",
"predicate": {
"logic": "AND",
"enchantment_level": {
"enchant": "minecraft:fire_aspect",
"op": "==",
"value": 0
}
},
"drop": {
"id": "minecraft:gunpowder",
"count": 1,
"nbt": {},
"modifiers": [
{
"mode": "add",
"function": "looting",
"enchant": "minecraft:fortune",
"include_offhand": true
},
{
"mode": "add",
"function": "looting",
"enchant": "minecraft:looting",
"include_offhand": true
}
]
}
}
]
}
Additional Notes
Compatibility and Migration
- The legacy right-click harvest mapping table method remains compatible in 5.2.0 and earlier versions.
- Starting with 5.2.1 and later versions, right-click harvest mapping will fully switch to data pack-driven configuration.
- If addon mods are not updated to the data pack-driven format in sync, they may drop air when right-click harvesting mature crops in 5.2.1 and later versions.
- It is recommended that addon mod authors migrate legacy mapping tables to
custom_lootdata packs as soon as possible, and complete configuration using fields such astarget_block,conditions,predicate,drop, andmodifiers. - When migrating, pay special attention that
typemust becustom_loot,condition_iduses strict exact matching and is case-sensitive, and client-side calls do not perform calculations and directly return air.
Removal of Legacy Commands
- Commands related to editing the legacy mapping table system will be removed in the next beta version.
- Do not continue to rely on legacy mapping table editing commands for configuration; for future maintenance, use data pack files exclusively.
- After legacy commands are removed, the legacy mapping table system will no longer be the recommended configuration entry point, and addon mods should complete data pack migration as soon as possible.
Changes
- Large-scale refactor of project package names and file directory structure, reorganizing the source code hierarchy to make the project structure clearer and more orderly.
- Does not involve changes to registry names or config options.
新内容
常规
数据包
右键收获映射
- 右键收获成熟作物的掉落映射已改由数据包驱动,原硬编码的“成熟作物方块 → 收获产出”映射表不再作为扩展配置来源。
- 现在可通过
custom_loot类型的数据包文件描述目标方块、判定条件、掉落物品与数量修饰器。 - 右键收获成熟作物时,模组会使用被右键方块的注册 ID 与文件中的
target_block匹配,匹配成功后该文件才会生效。 - 每个
conditions数组项都是一条独立判定规则;可按数组下标取用,也可通过condition_id供模组按文本查找。 - 条件命中后按对应
drop产出一个物品;一条规则只产出一个物品。 - 所有随机数、附魔等级读取等计算都只在本条条件判定通过后执行。
- 客户端调用不执行任何计算,直接返回空气;仅服务端生效。
- 解析或执行异常时按类型兜底:物品返回空气,计数返回
0,并附带日志警告。 - 缓存以文件路径为 key,执行
/reload会清空缓存。
JSON 格式总览
- 文件顶层必须包含
type、target_block、conditions。 type必须为custom_loot,模组端的 type 文本需要和它完全一致,用于校验文件类型。target_block使用方块命名空间 ID,例如minecraft:stone;模组会用传入方块的注册 ID 与此字段匹配,决定该文件是否生效。comment为可选注释,解析器直接忽略,仅方便数据包编写者阅读。conditions为条件规则数组;数组每一项是一条独立判定规则,序号输入就是取这个数组的下标。- 单条条件由
condition_id、predicate、drop组成;其中predicate与drop必填。 condition_id可选,供模组按文本查找本条规则;严格全等匹配,区分大小写。predicate用来校验传入实体是否满足本条规则;多个判定子项之间由logic组合。drop描述命中后产出的物品配置;包含物品 ID、基础数量、NBT/Item Component 与数量修饰器。modifiers按数组顺序依次执行;mode决定追加还是覆盖,function决定数量函数。
顶层字段
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
type |
string | 是 | 自定义数据包类型标识,必须为 custom_loot;模组端的 type 文本需要和它完全一致,用于校验文件类型 |
target_block |
string | 是 | 方块命名空间 ID;模组会用传入方块的注册 ID 和此字段匹配,决定该文件是否生效 |
comment |
string | 否 | 注释文本,解析器直接忽略,仅方便编写数据包的人阅读 |
conditions |
array | 是 | 条件规则数组;数组每一项是一条独立判定规则;序号输入就是取这个数组的下标 |
conditions 单条条件
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
condition_id |
string | 否 | 条件唯一标识,供模组按文本查找本条规则;区分大小写,严格全等匹配 |
predicate |
object | 是 | 判定规则集合,用来校验传入实体是否满足本条规则 |
drop |
object | 是 | 本条规则命中后产出的物品配置;一条规则只产出一个物品 |
predicate 判定对象
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
logic |
string | 是 | 多个判定子项之间的逻辑,仅支持 AND / OR |
enchantment_level |
object | 否 | 判定实体主手物品指定附魔等级;无附魔返回 0 |
potion_effect_remaining |
object | 否 | 判定实体指定药水效果剩余 tick;无效果返回 0 |
potion_effect_amplifier |
object | 否 | 判定实体药水放大器等级,速度 I 为 0;无效果返回 -1 |
mainhand_item |
object | 否 | 判定实体主手物品注册 ID 字符串;空手返回 minecraft:air |
offhand_item |
object | 否 | 判定实体副手物品注册 ID 字符串;空手返回 minecraft:air |
- 判定子项内部统一使用
enchant/effect、op、value字段。 op支持:==、!=、>、<、>=、<=。logic仅支持AND/OR,用于组合多个判定子项。- 附魔等级:无附魔返回
0。 - 药水剩余 tick:无效果返回
0。 - 药水放大器:无效果返回
-1。 - 主手 / 副手:空手返回
minecraft:air。
drop 物品配置
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
id |
string | 是 | 物品命名空间 ID |
count |
int | 否 | 基础数量,是修饰器执行前的初始值;如无此字段或格式非法,则默认 1 |
nbt |
object | 否 | 物品附加 NBT / Item Component;空对象代表无附加数据 |
modifiers |
array | 否 | 数量修饰器数组,按顺序执行;不填则直接使用 count 作为最终数量 |
modifiers是数组,按顺序依次执行修饰。- 不填
modifiers时,最终数量直接使用count。 count缺失或格式非法时按1处理。nbt使用空对象表示无附加数据。
modifiers 修饰器单条
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
mode |
string | 是 | 执行模式:add 追加、set 覆盖当前数量 |
function |
string | 是 | 数量函数:uniform 均匀随机、looting 模拟抢夺附魔 |
min |
数字 / 动态对象 | uniform 专用 | 均匀分布最小值;支持固定数字或动态附魔对象 |
max |
数字 / 动态对象 | uniform 专用 | 均匀分布最大值;支持固定数字或动态附魔对象,可绑定主 / 副手附魔等级 |
enchant |
string | looting 专用 | 要读取的附魔 ID |
include_offhand |
boolean | looting 专用 | 是否把副手的该附魔等级一起叠加计算 |
mode为add:在当前计算好的数量基础上,加上本次函数算出的值。mode为set:直接把当前数量覆盖为本函数结果,忽略前面已经算出的数量。uniform为均匀分布;min、max支持固定数字或动态附魔对象。uniform如果min > max,输出0。looting模拟抢夺;附魔等级即为本次增加的数值,和原版抢夺逻辑对齐。looting的include_offhand为true时,主手 + 副手该附魔等级叠加;为false时只取主手。looting附魔不存在或对应手为空时,该手附魔等级按0计算。- 修饰器计算结果如果小于
0,最终数量强制钳位到0。
动态附魔对象
{
"type": "enchant_level",
"enchant": "minecraft:fortune",
"hand": "mainhand"
}
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
type |
string | 是 | 固定为 enchant_level |
enchant |
string | 是 | 附魔 ID |
hand |
string | 是 | mainhand / offhand,读取对应手的附魔等级 |
- 动态附魔对象可用于
uniform的min/max。 hand可选值为mainhand/offhand。- 读取对应手附魔等级;无附魔或对应手为空时按
0处理。
数量计算与边界规则
- 初始数量来自
drop.count;缺失或非法时默认1。 modifiers按数组顺序依次执行。add在当前数量基础上追加函数结果。set直接用函数结果覆盖当前数量,忽略此前已经算出的数量。uniform生成均匀随机值;min > max时输出0。looting读取指定附魔等级并作为本次增加数值;include_offhand控制是否叠加副手。- 所有随机、附魔取值都在本条条件判定通过之后才计算。
- 修饰器计算结果小于
0时,最终数量钳位到0。 - 一条条件规则只产出一个物品。
公共规则与异常处理
- 运算符仅支持
==、!=、>、<、>=、<=。 logic仅支持AND/OR。- 仅服务端生效;客户端调用不执行任何计算,直接返回空气 /
0。 - 缓存 key 为文件路径,执行
/reload清空缓存。 - 所有异常兜底:物品返回空气,计数返回
0,并附带日志警告。 condition_id严格全等匹配,区分大小写。type必须与输入文本完全一致,用于校验文件类型。target_block必须与传入方块注册 ID 匹配,文件才会生效。comment会被解析器忽略,不参与任何逻辑。
JSON 示例
- 示例一:矿石种植工艺模组中粗铜作物的右键掉落的
custom_lootJSON。
{
"type": "crop_mapping",
"target_block": "cp_lib:copper_crop",
"comment": "矿石种植工艺模组中粗铜作物的右键掉落的自定义战利品表",
"conditions": [
{
"condition_id": "with_fire_aspect",
"predicate": {
"logic": "AND",
"enchantment_level": {
"enchant": "minecraft:fire_aspect",
"op": ">",
"value": 0
}
},
"drop": {
"id": "minecraft:copper_ingot",
"count": 1,
"nbt": {},
"modifiers": [
{
"mode": "add",
"function": "looting",
"enchant": "minecraft:fortune",
"include_offhand": true
},
{
"mode": "add",
"function": "looting",
"enchant": "minecraft:looting",
"include_offhand": true
}
]
}
},
{
"condition_id": "without_fire_aspect",
"predicate": {
"logic": "AND",
"enchantment_level": {
"enchant": "minecraft:fire_aspect",
"op": "==",
"value": 0
}
},
"drop": {
"id": "minecraft:raw_copper",
"count": 1,
"nbt": {},
"modifiers": [
{
"mode": "add",
"function": "looting",
"enchant": "minecraft:fortune",
"include_offhand": true
},
{
"mode": "add",
"function": "looting",
"enchant": "minecraft:looting",
"include_offhand": true
}
]
}
}
]
}
- 示例二:矿石种植工艺模组中火药作物的右键掉落的
custom_lootJSON。
{
"type": "crop_mapping",
"target_block": "cp_lib:gunpowder_crop",
"comment": "矿石种植工艺模组中火药作物的右键掉落的自定义战利品表",
"conditions": [
{
"condition_id": "with_fire_aspect",
"predicate": {
"logic": "AND",
"enchantment_level": {
"enchant": "minecraft:fire_aspect",
"op": ">",
"value": 0
}
},
"drop": {
"id": "minecraft:gunpowder",
"count": 1,
"nbt": {},
"modifiers": [
{
"mode": "add",
"function": "looting",
"enchant": "minecraft:fortune",
"include_offhand": true
},
{
"mode": "add",
"function": "looting",
"enchant": "minecraft:looting",
"include_offhand": true
}
]
}
},
{
"condition_id": "without_fire_aspect",
"predicate": {
"logic": "AND",
"enchantment_level": {
"enchant": "minecraft:fire_aspect",
"op": "==",
"value": 0
}
},
"drop": {
"id": "minecraft:gunpowder",
"count": 1,
"nbt": {},
"modifiers": [
{
"mode": "add",
"function": "looting",
"enchant": "minecraft:fortune",
"include_offhand": true
},
{
"mode": "add",
"function": "looting",
"enchant": "minecraft:looting",
"include_offhand": true
}
]
}
}
]
}
补充说明
兼容性与迁移
- 旧版右键收获映射表方法在5.2.0 及之前版本保持兼容。
- 自5.2.1 及后续版本起,右键收获映射将全面转向数据包驱动。
- 附属模组若未同步更新为数据包驱动格式,在 5.2.1 及后续版本中可能出现右键收获成熟作物时掉落空气。
- 建议附属模组作者尽快将旧映射表迁移为
custom_loot数据包,并按target_block、conditions、predicate、drop、modifiers等字段完成配置。 - 迁移时请特别注意
type必须为custom_loot,condition_id严格全等匹配且区分大小写,客户端调用不会执行计算并直接返回空气。
旧版指令移除
- 用于编辑旧版映射表系统的相关指令将在下一个测试版中移除。
- 请勿继续依赖旧版映射表编辑指令进行配置;后续维护请统一使用数据包文件。
- 旧指令移除后,旧版映射表系统将不再作为推荐的配置入口,附属模组应尽快完成数据包迁移。
更改
- 大规模重构项目包名与文件目录结构,整理源码层级,让项目结构更加清晰有序。
- 不涉及注册名、配置项的变更。
Projects on Modrinth are automatically available through a Maven repository for use with JVM build tools such as Gradle. To learn more about the Modrinth Maven API, click here.
Note: When available, you should use the creator's maven repo instead as it will have transitive dependency information that the Modrinth Maven API does not. You may also end up with duplicate dependencies if you use a mix of Modrinth and non-Modrinth Maven repositories for your dependencies, because the group identifier will be different when served through the Modrinth Maven API.
Maven coordinates:
Version ID:
build.gradle:
repositories {
exclusiveContent {
forRepository {
maven {
name = "Modrinth"
url = "https://api.modrinth.com/maven"
}
}
// forRepositories(fg.repository) // Uncomment when using ForgeGradle
filter {
includeGroup "maven.modrinth"
}
}
}
// Standard Gradle dependency
dependencies {
implementation "maven.modrinth:srNXPOFJ:DHJC62tC"
}
// Legacy Loom dependency
dependencies {
modImplementation "maven.modrinth:srNXPOFJ:DHJC62tC"
}

