Cyn's CustomModelData
一个适用于 Minecraft 1.21.11 (Java 21+) 的 Spigot/Paper 插件,旨在让使用 custom_model_data(资源包用于切换物品模型的组件)变得快速且轻松。你可以设置手中物品的模型数据,通过实时的 GUI 物品编辑器对其进行编辑(包括属性、附魔、伤害、药水效果等),从配置规则中批量应用模型数据,并将模型数据绑定到物品显示名称上,确保命名物品始终获得正确的模型。
安装
- 将 jar 文件放入
plugins/ 目录。
- 启动服务器(推荐 Paper 1.21.11)。会自动生成
plugins/CustomModelData/config.yml。
- 编辑配置文件并运行
/cmddata reload。
GUI 物品编辑器
手持一个物品并运行 /cmddata gui。每次更改都会立即应用到该物品上,因此预览效果与你手中的物品完全一致。布局在所有屏幕上保持一致:左上角为返回,中上部为你正在编辑的物品,右上角为关闭,其余部分则填充了相同的按钮。
主菜单分类:
| 按钮 |
编辑内容 |
| Model Data |
custom_model_data 整数及浮点数值 |
| Name & Lore |
显示名称、背景描述行、颜色代码 |
| Enchantments |
可应用于该物品的所有附魔 |
| Attributes & Stats |
攻击伤害、速度、生命值、护甲值等 |
| Damage & Durability |
伤害、最大耐久、不可破坏 |
| Potion Effects |
自定义药水效果(药水类物品) |
| Misc Settings |
堆叠数量、稀有度、闪烁效果、火焰抗性、物品模型、提示标签 |
此外还支持还原所有更改和撤销(最多支持 gui.undo-depth 步操作)。
每当需要精确数值时,会弹出一个居中的数字键盘;文本值(名称、背景描述、物品模型 ID)则在聊天栏中输入(支持 cancel 或 clear)。
控制方式:左键点击增加 / +1 步进,右键点击减少,Shift+点击大步长调整,中键点击打开数字键盘,按 Q 丢弃以移除/清空。
命令
手持物品相关:
/cmddata gui - 打开物品编辑器
/cmddata set <number> / /cmddata add <number> - 设置/添加模型数据
/cmddata get - 显示当前模型数据
/cmddata reset - 移除模型数据组件
/cmddata hand - 更改你的默认手(主手/副手)
/cmddata give <player> <number> - 为其他玩家设置(管理员权限)
基于名称的(永久绑定,保存至 names.yml):
/cmddata name set <name> <number> - 重命名手中物品,设置其模型数据并记住该绑定关系
/cmddata name apply - 读取手中物品的名称并应用与其绑定的模型数据
/cmddata name applyall [player] - 在整个背包中应用所有已记住的名称绑定
/cmddata name bind/unbind/lookup/list - 管理绑定关系
/cmdname <name> <number> / /cmdname <name> - 上述工作流的快捷方式
从配置进行批量更改:
/cmddata mass apply [self|all|<player>] - 执行配置规则
/cmddata mass scan [self|all|<player>] - 预览而不进行任何更改
/cmddata mass add/remove/list/test - 在 config.yml 内编辑规则
/cmddata reload - 重新加载配置
批量规则配置
简单形式 - mass.items:
mass:
items:
DIAMOND_SWORD: 1001 # 按材质匹配
minecraft:stone: 2000 # 命名空间格式也有效
"Ruby Staff": 3000 # 按物品的自定义显示名称匹配
"@Light": 4001 # '@' 强制进行名称匹配
高级形式 - mass.rules:
mass:
rules:
- item: LEATHER_HELMET # 必填
model-data: 5000 # 必填
name: 'Ruby Cap' # 仅匹配具有此自定义名称的物品
set-name: '&6Ruby Cap' # 为匹配到的物品赋予此名称
data: 100 # 仅匹配(并设置)此伤害值
slots: [armor, storage] # mainhand | offhand | armor | storage
overwrite: false # false = 跳过已有模型数据的物品
规则按文件顺序应用,对于每个物品堆栈,第一个匹配的规则生效。若启用 settings.apply-on-join: true,它们会在每次玩家加入时自动运行。
权限
| 节点 |
默认值 |
授予权限 |
cmddata.use |
所有人 |
对自己使用手持、名称和 GUI 命令 |
cmddata.gui |
所有人 |
打开物品编辑器 |
cmddata.admin |
op |
批量规则、/cmddata give、/cmddata reload |
兼容性
仅限服务端。已在 Paper 1.21.11 上测试,基于 spigot-api 1.21.11-R0.1 构建,需要 Java 21+。
Cyn's CustomModelData
A Spigot/Paper plugin for Minecraft 1.21.11 (Java 21+) that makes working with custom_model_data - the component resource packs use to swap item models - quick and painless. Set model data on the item in your hand, edit it (plus attributes, enchants, damage, potion effects and more) in a live GUI item editor, mass-apply model data from config rules, and bind model data to item display names so named items always get the right model.
Install
- Drop the jar into
plugins/.
- Start the server (Paper 1.21.11 recommended).
plugins/CustomModelData/config.yml is generated.
- Edit the config and run
/cmddata reload.
GUI item editor
Hold an item and run /cmddata gui. Every change is applied to the item immediately, so the preview is exactly what you hold. The layout is consistent on every screen: back (top left), the item you are editing (top middle), close (top right), and the rest of the menu filled with the same buttons.
Main menu categories:
| Button |
What it edits |
| Model Data |
custom_model_data ints and the float values |
| Name & Lore |
display name, lore lines, colour codes |
| Enchantments |
every enchantment that can apply to the item |
| Attributes & Stats |
attack damage, speed, health, armour, ... |
| Damage & Durability |
damage, max damage, unbreakable |
| Potion Effects |
custom potion effects (potion items) |
| Misc Settings |
stack size, rarity, glint, fire resistance, item model, tooltip flags |
Plus revert all changes and undo (up to gui.undo-depth steps).
A centred number pad pops up whenever you need an exact numeric value; text values (name, lore, item model id) are typed in chat (cancel or clear supported).
Controls: left click add / +1 step, right click subtract, shift click big step, middle click open the number pad, Q drop to remove / clear.
Commands
Hand item:
/cmddata gui - open the item editor
/cmddata set <number> / /cmddata add <number> - set / add model data
/cmddata get - show the current model data
/cmddata reset - remove the model data component
/cmddata hand - change your default hand (main / off)
/cmddata give <player> <number> - set it on someone else (admin)
Name based (permanent bindings, saved to names.yml):
/cmddata name set <name> <number> - rename the held item, set its model data and remember the binding
/cmddata name apply - read the held item's name and apply the model data bound to it
/cmddata name applyall [player] - apply every remembered name across an inventory
/cmddata name bind/unbind/lookup/list - manage the bindings
/cmdname <name> <number> / /cmdname <name> - shortcut for the same workflow
Mass change from config:
/cmddata mass apply [self|all|<player>] - run the config rules
/cmddata mass scan [self|all|<player>] - preview without changing anything
/cmddata mass add/remove/list/test - edit rules inside config.yml
/cmddata reload - reload the configs
Mass rule config
Simple form - mass.items:
mass:
items:
DIAMOND_SWORD: 1001 # by material
minecraft:stone: 2000 # namespaced works too
"Ruby Staff": 3000 # by the item's custom display name
"@Light": 4001 # '@' forces name matching
Advanced form - mass.rules:
mass:
rules:
- item: LEATHER_HELMET # required
model-data: 5000 # required
name: 'Ruby Cap' # only match items with this custom name
set-name: '&6Ruby Cap' # give matched items this name
data: 100 # only match (and set) this damage value
slots: [armor, storage] # mainhand | offhand | armor | storage
overwrite: false # false = skip items that already have model data
Rules are applied in file order and the first matching rule wins for each stack. With settings.apply-on-join: true they run automatically for every player on join.
Permissions
| Node |
Default |
Grants |
cmddata.use |
everyone |
hand, name and GUI commands on yourself |
cmddata.gui |
everyone |
open the item editor |
cmddata.admin |
op |
mass rules, /cmddata give, /cmddata reload |
Compatibility
Server side only. Tested on Paper 1.21.11, built against spigot-api 1.21.11-R0.1, requires Java 21+.
评论 0
登录后参与评分
还没有评论,来抢沙发吧