跳到主要内容

🗡️ 物品

概览

完整的物品配置包含以下部分:

  • material 必填

material 作为物品的基础模板,例如 paperwooden_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-dataitem-model

警告

在配置模型部分时,你必须指定 custom-model-dataitem-model 。如果你的资源包支持 1.21.2 或更高版本,插件将自动使用物品标识符作为 item-model 的值。

完整配置预览
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