zh_cn:tutorial:items
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
zh_cn:tutorial:items [2025/04/01 07:50] – [添加物品模型、纹理和模型映射] solidblock | zh_cn:tutorial:items [2025/04/01 08:00] (current) – [下一步] solidblock | ||
---|---|---|---|
Line 147: | Line 147: | ||
该物品模型映射将指定物品使用对应的物品模型。 | 该物品模型映射将指定物品使用对应的物品模型。 | ||
+ | |||
+ | > :!: 手动创建这些文件显然会很累。了解数据生成可看看 [[datagen_model]] 页面。 | ||
+ | |||
===== 创建物品类 ===== | ===== 创建物品类 ===== | ||
Line 205: | Line 208: | ||
这个例子中,物品默认不可破坏,并隐藏关于这一点的物品提示: | 这个例子中,物品默认不可破坏,并隐藏关于这一点的物品提示: | ||
< | < | ||
- | // For versions below 1.21.2: | + | // 对于 |
public static final CustomItem CUSTOM_ITEM = register(" | public static final CustomItem CUSTOM_ITEM = register(" | ||
.component(DataComponentTypes.UNBREAKABLE, | .component(DataComponentTypes.UNBREAKABLE, | ||
- | | + | |
+ | | ||
public static final Item CUSTOM_ITEM = register(" | public static final Item CUSTOM_ITEM = register(" | ||
.component(DataComponentTypes.UNBREAKABLE, | .component(DataComponentTypes.UNBREAKABLE, | ||
+ | | ||
+ | // 对于从 1.21.4 及以后: | ||
+ | public static final Item CUSTOM_ITEM = register(" | ||
+ | .component(DataComponentTypes.UNBREAKABLE, | ||
</ | </ | ||
Line 219: | Line 227: | ||
// 我们新物品的实例,最大堆叠数为 16 | // 我们新物品的实例,最大堆叠数为 16 | ||
| | ||
- | // For versions below 1.21.2: | + | // 对于 |
public static final CustomItem CUSTOM_ITEM = register(" | public static final CustomItem CUSTOM_ITEM = register(" | ||
- | // For versions since 1.21.2: | + | |
+ | | ||
public static final Item CUSTOM_ITEM = register(" | public static final Item CUSTOM_ITEM = register(" | ||
[...] | [...] | ||
Line 288: | Line 297: | ||
类似地,你也可以使用 '' | 类似地,你也可以使用 '' | ||
===== 下一步 ===== | ===== 下一步 ===== | ||
- | 试着[[zh_cn: | + | 试着[[itemgroup|将你的物品添加到一个物品组中]]。你的物品还没有名字,所以还可以看看[[lang|如何创建语言文件]]。 |
zh_cn/tutorial/items.1743493827.txt.gz · Last modified: 2025/04/01 07:50 by solidblock