Basic Items
It's time to create your very first item!
First, you need a data pack.
Once you have a created a data pack, you can add a file named my_first_item.json
under data/example/item
.
- data/example/item/my_first_item.json
{ "base": { "translation_key": "item.example.my_first_item" } }
That's all you need!
Now you can load the world and give yourself the item using /give @s example:my_first_item
.
However, you'll probably notice that your item doesn't look all that pretty. That's because your item does not have a model yet! You can add a model to a resource pack the same way you would add a model for a vanilla item; Just make sure that you use the right namespace.
- assets/example/model/item/my_first_item.json
{ "parent": "minecraft:item/handheld", "textures": { "layer0": "example:item/my_first_item" } }
That already looks a lot better. Though… Something still isn't right! How about you add a name for your item via language files.
- assets/example/lang/en_us.json
{ "item.example.my_first_item": "My First Item" }
Reload the resource pack, and perfect, that's it! That's all you need to create your very first item. Now it's time to amp up your item by adding Item Components!