🗡️ 物品
概览
完整的物品配置包含以下部分:
- material 必填
material
作为物品的基础模板,例如 paper
或 wooden_sword
。
- client-bound-material 可选
client-bound-material
表示客户端用于渲染该物品的基础材质。你可以使用此功能为服务器端侧和客户端侧的物品分配完全不同的基础材质,从而影响它们在服务器或客户端环境中的特定行为。
- custom-model-data 可选
custom-model-data
是一个正整数,具有相同材质的自定义物品应使用不同的 custom-model-data 值。该值决定了物品显示的模型,对下面的模型部分至关重要。
- item-model (1.21.2+) 可选
定义此物品模型的命名空间ID。例如 default:custom_book
提示
使用 custom-model-data 具有更好的版本兼容性,因为它自 1.14 起就已推出,而 item_model 至少需要 1.21.2 才能使用。
您可以同时使用 custom-model-data
和 item-model
。
警告
在配置模型部分时,你必须指定 custom-model-data
或 item-model
。如果你的资源包支持 1.21.2 或更高版本,插件将自动使用物品标识符作为 item-model
的值。
-
client-bound-model 可选 默认值: config.yml 中的全局值
-
oversized-in-gui (1.21.6+) 可选 默认值: true
-
hand-animation-on-swap 可选 默认值: true
-
behavior(s) 可选
-
settings 可选
-
events 可选
-
category 可选
完整配置预览
items:
default:palm_log:
material: paper
custom-model-data: 1000
item-model: default:palm_log
settings:
fuel-time: 300
tags:
- "default:palm_logs"
- "minecraft:logs"
- "minecraft:logs_that_burn"
data:
display-name: "<!i>棕榈原木"
model:
type: "minecraft:model"
path: "minecraft:item/custom/palm_log"
generation:
parent: "minecraft:block/custom/palm_log"
oversized-in-gui: true
hand-animation-on-swap: true
client-bound-model: false
behavior:
type: block_item
block: default:palm_log