tutorial:items
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
tutorial:items [2025/04/01 07:50] – [Adding model and textures] solidblock | tutorial:items [2025/04/01 08:57] (current) – [Adding model, texture and model mapping] solidblock | ||
---|---|---|---|
Line 128: | Line 128: | ||
In the method '' | In the method '' | ||
- | ===== Adding model and textures | + | ===== Adding model, texture |
If you registered your item properly in the first step, you can successfully get your item by typing command ''/ | If you registered your item properly in the first step, you can successfully get your item by typing command ''/ | ||
Line 134: | Line 134: | ||
[Server-Worker-1/ | [Server-Worker-1/ | ||
- | That's because we haven' | + | That's because we haven' |
* Item model: '' | * Item model: '' | ||
* Item texture: '' | * Item texture: '' | ||
- | * Item model mapping | + | * Item model definition |
Our example texture can be found [[https:// | Our example texture can be found [[https:// | ||
Line 153: | Line 153: | ||
The '' | The '' | ||
- | An item model mapping | + | An item model definition |
<code javascript / | <code javascript / | ||
{ | { | ||
Line 163: | Line 163: | ||
</ | </ | ||
- | The item model mapping | + | The item model definition |
+ | > :!: Creating these files manually for each item can be tiring. You may refer to [[datagen_model]] for data generation. | ||
===== Creating an Item class ===== | ===== Creating an Item class ===== | ||
Line 225: | Line 226: | ||
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, | ||
+ | | ||
+ | // For versions since 1.21.4: | ||
+ | public static final Item CUSTOM_ITEM = register(" | ||
+ | .component(DataComponentTypes.UNBREAKABLE, | ||
</ | </ | ||
Line 238: | Line 244: | ||
// For versions below 1.21.2: | // 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: | // For versions since 1.21.2: | ||
public static final Item CUSTOM_ITEM = register(" | public static final Item CUSTOM_ITEM = register(" | ||
Line 304: | Line 311: | ||
Similarly, you can use a '' | Similarly, you can use a '' | ||
===== Next Steps ===== | ===== Next Steps ===== | ||
- | [[tutorial:itemgroup|Add your item to your own ItemGroup]]. | + | Try [[itemgroup|adding |
tutorial/items.1743493824.txt.gz · Last modified: 2025/04/01 07:50 by solidblock