Cobblemon Gym Badges
Cobblemon Gym Badges 添加了一个徽章压制台(Badge Press),用于制作自定义训练家徽章(以及缎带),并支持基于角色的访问权限控制。
功能
- 带有专属合成界面的徽章压制台方块
- 道馆馆主角色,用于限制徽章的合成权限
- 支持通过数据包和资源包自定义徽章和缎带
- JEI / EMI / REI 集成(每位玩家仅显示其可合成的配方)
- 资源包优先设计,确保自定义素材位于 jar 包之外
- 本模组实质上包含了在 JEI / EMI / REI 中查看自定义物品的功能,类似于 Easy Item List 模组
使用徽章压制台
- 放置一个徽章压制台。
- 将核心原料放入上方槽位,基础原料放入下方槽位。
- 如果你拥有所需的角色(如有),徽章将出现在输出槽位中。
创建自定义徽章(数据包 + 资源包)
你需要两个部分:
- 用于定义徽章和配方的数据包
- 用于模型和纹理的资源包
关于数据包/资源包的信息
数据包:徽章定义
路径:data/<namespace>/cgb/badge/<id>.json
(这里的 cgb 是徽章的注册表命名空间。)
命名提示: <id> 是徽章的身份标识和翻译键。
如果你想制作“冠军缎带”,请将文件命名为 champion_ribbon.json,并为
badge.<namespace>.champion_ribbon 添加翻译文本。内部物品 ID 始终为 cgb:badge、cgb:badge_ribbon
或 cgb:badge_untagged,具体取决于 badgebox 字段,但玩家只能看到徽章定义的名称。
示例(徽章):
{
"name": { "text": "Fire Badge" },
"theme": "fire",
"texture": "cgb:item/fire_badge",
"badgebox": "badge"
}
示例(缎带):
{
"name": { "text": "Champion Ribbon" },
"theme": "champion",
"texture": "cgb:item/blue_ribbon",
"badgebox": "ribbon"
}
字段概览:
name(可选):显示名称组件。
theme(可选):主题字符串。如果省略,则使用文件名作为主题。
role(可选):所需角色名称(不带 gym_leader_ 前缀)。
tags(可选):应用于徽章物品的额外物品标签。
model_data(可选):自定义模型数据值。如果省略,模组会根据每个 badgebox 类型自动分配唯一值。
model 或 texture(可选):要使用的物品模型 ID。如果仅设置 texture,模组会生成物品模型。
badgebox(可选):none、badge 或 ribbon。
- 这控制物品获得的 BadgeBox 标签。
badge 是默认值(添加 badgebox:badges)。
ribbon 添加 badgebox:ribbons。
none 不添加任何 BadgeBox 标签。
- 标签名称来自 BadgeBox 模组且是固定的;此字段隐藏了该复杂性。
数据包:徽章配方
路径:data/<namespace>/recipe/<id>.json
示例:
{
"type": "cgb:badgemaking",
"core": { "item": "minecraft:gold_ingot" },
"base": { "item": "minecraft:blue_dye" },
"result": {
"theme": "champion"
}
}
core = 徽章压制台上方的槽位
base = 徽章压制台下方的槽位
资源包:模型 + 纹理
路径:
- 纹理:
assets/<namespace>/textures/item/<id>.png
对于简单的 2D 徽章/缎带,你只需要提供纹理。模组会在运行时生成基础物品模型和
CustomModelData 覆盖层,因此你不需要提供 badge.json、badge_ribbon.json
或每个徽章单独的模型文件。
如果你的徽章定义使用了 "texture": "cgb:item/blue_ribbon",你还必须提供:
assets/cgb/textures/item/blue_ribbon.png
如果你想要自定义物品模型(3D 或分层),请在徽章定义中设置 "model": "<namespace>:item/<id>"
并自行包含模型 JSON 文件。
模型选择(如何选择纹理):
- 本模组使用 CustomModelData 来为每个徽章选择正确的模型。
- 如果省略
model_data,模组会根据每个 badgebox 类型自动分配唯一值。
- 基础模型和覆盖层会在客户端自动生成。
如果需要跨资源包稳定的 ID,你仍然可以手动设置 model_data,但这不是必需的。
加载你的资源包
- 数据包:将数据包放入
world/datapacks/ 并运行 /reload。
- 资源包:将资源包放入
resourcepacks/ 并在资源包菜单中启用它。
故障排除
- JEI/EMI/REI 中缺少纹理通常意味着模型文件缺失。
如果你使用了
model,请确保徽章定义中的模型 ID 指向真实的物品模型 JSON 文件。
- 如果你手动设置了
model_data,请确保每个徽章在每个 badgebox 类型中具有唯一的数字。
否则,让模组自动分配即可。
Cobblemon Gym Badges
Cobblemon Gym Badges adds a Badge Press for crafting custom gym badges (and ribbons) with role-based access.
Features
- Badge Press block with a dedicated crafting UI
- Gym Leader roles to gate badge crafting
- Datapack + resourcepack support for custom badges and ribbons
- JEI / EMI / REI integration (only craftable recipes are shown per player)
- Resourcepack-first design so custom art stays outside the jar
- This basically includes functionality to see Custom Items in JEI / EMI / REI like the Easy Item List Mod
Using the Badge Press
- Place a Badge Press.
- Put the core ingredient in the top slot and the base ingredient in the bottom slot.
- If you have the required role (if any), the badge will appear in the output slot.
Creating Custom Badges (Datapack + Resourcepack)
You need two parts:
- A datapack for badge definitions and recipes
- A resourcepack for models and textures
Information on Datapacks / Resourcepacks
Datapack: Badge Definitions
Path: data/<namespace>/cgb/badge/<id>.json
(cgb here is the registry namespace for badges.)
Naming tip: the <id> is the badge’s identity and translation key.
If you want a “Champion Ribbon”, name the file champion_ribbon.json and add a translation for
badge.<namespace>.champion_ribbon. The internal item id is always cgb:badge, cgb:badge_ribbon,
or cgb:badge_untagged based on badgebox, but players only see the badge definition name.
Example (badge):
{
"name": { "text": "Fire Badge" },
"theme": "fire",
"texture": "cgb:item/fire_badge",
"badgebox": "badge"
}
Example (ribbon):
{
"name": { "text": "Champion Ribbon" },
"theme": "champion",
"texture": "cgb:item/blue_ribbon",
"badgebox": "ribbon"
}
Field overview:
name (optional): Display name component.
theme (optional): Theme string. If omitted, uses the file name as the theme.
role (optional): Required role name (without the gym_leader_ prefix).
tags (optional): Extra item tags to apply to the badge item.
model_data (optional): Custom model data value. If omitted, the mod auto-assigns a unique value per badgebox type.
model or texture (optional): Item model id to use. If you set texture only, the mod generates the item model.
badgebox (optional): none, badge, or ribbon.
- This controls which BadgeBox tag the item gets.
badge is the default (adds badgebox:badges).
ribbon adds badgebox:ribbons.
none adds no BadgeBox tag.
- The tag names come from the BadgeBox mod and are fixed; this field hides that complexity.
Datapack: Badge Recipes
Path: data/<namespace>/recipe/<id>.json
Example:
{
"type": "cgb:badgemaking",
"core": { "item": "minecraft:gold_ingot" },
"base": { "item": "minecraft:blue_dye" },
"result": {
"theme": "champion"
}
}
core = top slot in the Badge Press
base = bottom slot in the Badge Press
Resourcepack: Models + Textures
Paths:
- Textures:
assets/<namespace>/textures/item/<id>.png
You only need textures for simple 2D badges/ribbons. The mod generates the base item models and
CustomModelData overrides at runtime, so you do not need to ship badge.json, badge_ribbon.json,
or per-badge model files.
If your badge definition uses "texture": "cgb:item/blue_ribbon", you must also provide:
assets/cgb/textures/item/blue_ribbon.png
If you want a custom item model (3D or layered), set "model": "<namespace>:item/<id>" in the badge definition
and include the model JSON yourself.
Model selection (how textures are chosen):
- This mod uses CustomModelData to select the right model for each badge.
- If
model_data is omitted, the mod auto-assigns unique values per badgebox type.
- The base models and overrides are generated automatically on the client.
You can still set model_data manually if you need stable IDs across packs, but it is not required.
Loading Your Packs
- Datapack: put the pack in
world/datapacks/ and run /reload.
- Resourcepack: put the pack in
resourcepacks/ and enable it in the Resource Packs menu.
Troubleshooting
- Missing texture in JEI/EMI/REI usually means the model file is missing.
If you use
model, make sure the model id in your badge definition points at a real item model JSON.
- If you set
model_data manually, ensure each badge has a unique number per badgebox type.
Otherwise, let the mod auto-assign it.
评论 0
登录后参与评分
还没有评论,来抢沙发吧