Croparium

Mining using hands is extremely unhealthy! This mod make resources growable!
Back to Files

Croparium 5.1.9-beta

File namecp_lib-5.1.9-beta-fabric-26.1.2.jar
Uploader
LitQALitQA
Uploaded
Nov 23, 2026
Downloads
4
Size
2.3 MB
Mod Loaders
FabricQuilt
File ID
9768782
Type
B
Beta
Supported game versions
  • 26.1.2
  • 26.1.1
  • 26.1

Curse Maven Snippet

Fabric

modImplementation "curse.maven:croparium-1349954:9768782"

Quilt

modImplementation "curse.maven:croparium-1349954:9768782"

Learn more about Curse Maven

What's new

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_loot data 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_block in the file. The file only takes effect after a successful match.
  • Each entry in the conditions array is an independent rule. It can be selected by array index, or looked up by text via condition_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 /reload clears the cache.

JSON Format Overview

  • The file top level must contain type, target_block, and conditions.
  • type 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 uses a block namespace ID, such as minecraft:stone. The mod matches the registry ID of the passed block against this field to determine whether the file takes effect.
  • comment is an optional comment. The parser ignores it directly; it is only for data pack authors to read.
  • conditions is 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, and drop; predicate and drop are required.
  • condition_id is optional and allows the mod to look up this rule by text. Matching is strict and exact, and case-sensitive.
  • predicate is used to check whether the passed entity satisfies this rule; multiple predicate sub-entries are combined by logic.
  • drop describes the item configuration produced when the rule matches; it contains the item ID, base count, NBT/Item Component, and count modifiers.
  • modifiers are executed in array order; mode determines whether to add or set, and function determines 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, and value fields.
  • op supports: ==, !=, >, <, >=, <=.
  • logic only supports AND / OR and is used to combine multiple predicate sub-entries.
  • Enchantment level: returns 0 if not enchanted.
  • Potion remaining ticks: returns 0 if the effect is absent.
  • Potion amplifier: returns -1 if the effect is absent.
  • Mainhand / offhand: returns minecraft:air for 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
  • modifiers is an array and modifiers are executed in order.
  • If modifiers is omitted, the final count directly uses count.
  • If count is missing or in an invalid format, it is treated as 1.
  • nbt uses 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
  • mode set to add: adds the value calculated by this function to the current calculated count.
  • mode set to set: directly overwrites the current count with this function's result, ignoring any count calculated previously.
  • uniform is a uniform distribution; min and max support fixed numbers or dynamic enchantment objects.
  • For uniform, if min > max, outputs 0.
  • looting simulates Looting; the enchantment level is the value added this time, aligned with vanilla Looting logic.
  • For looting, when include_offhand is true, the mainhand + offhand levels of that enchantment are added together; when false, 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 as 0.
  • If a modifier calculation result is less than 0, the final count is forcibly clamped to 0.

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's min / max.
  • hand can be mainhand / 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 to 1.
  • modifiers are executed in array order.
  • add adds the function result to the current count.
  • set directly overwrites the current count with the function result, ignoring any count calculated previously.
  • uniform generates a uniform random value; if min > max, outputs 0.
  • looting reads the specified enchantment level and uses it as the value added this time; include_offhand controls 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 to 0.
  • A condition rule produces only one item.

Common Rules and Exception Handling

  • Operators only support ==, !=, >, <, >=, <=.
  • logic only supports AND / 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 /reload clears the cache.
  • All exceptions fall back: items return air, counts return 0, with a log warning attached.
  • condition_id uses strict exact matching and is case-sensitive.
  • type must exactly match the input text and is used to validate the file type.
  • target_block must match the passed block registry ID for the file to take effect.
  • comment is ignored by the parser and does not participate in any logic.

JSON Examples

  • Example 1: The custom_loot JSON 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_loot JSON 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_loot data packs as soon as possible, and complete configuration using fields such as target_block, conditions, predicate, drop, and modifiers.
  • When migrating, pay special attention that type must be custom_loot, condition_id uses 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_loot JSON。
{
  "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_loot JSON。
{
  "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 严格全等匹配且区分大小写,客户端调用不会执行计算并直接返回空气。
旧版指令移除
  • 用于编辑旧版映射表系统的相关指令将在下一个测试版中移除。
  • 请勿继续依赖旧版映射表编辑指令进行配置;后续维护请统一使用数据包文件。
  • 旧指令移除后,旧版映射表系统将不再作为推荐的配置入口,附属模组应尽快完成数据包迁移。

更改

  • 大规模重构项目包名与文件目录结构,整理源码层级,让项目结构更加清晰有序。
  • 不涉及注册名、配置项的变更。