Minecraft MOD Add Item resources [1.10.2/1.12.2]

TOP > Tutorial list > Minecraft MOD Add Item resources [1.10.2/1.12.2]


posted 28 April 2018

This time is a tutorial for adding item resources in Minecraft JE.

For the item, the resource handles data on the following matters.

・Localized name of item
・Model of item
・Texture to paste on model

Besides, the resource includes sound effect and particle when using a item.

However, sound effect and particle are not an essential element in adding a item. So, I will focus on the item name, model and texture. 

The source of Chinjufu MOD is released on GitHub. If you are interested please visit there.

 

1. Tree structure of resource package

First of all, a tutorial on the structure of the resource package.

The resource package of Chinjufu Mod has a tree structure like the image.

The resource package of Chinjufu Mod

For classes that are the design drawing of items and blocks, it can be made into a category that is easy for producers to understand. As you can see in the ‘import’ at the top of the class, the reason is that it knows the referenced file with the address.

On the other hand, resources are basically the same as the structure of Minecraft’s resource package. The reason is to match the rule that Minecraft uses in the resource package. Unless you do special things, I think that it is better to match Minecraft rule.

 

2. Localizing item names

When creating a class and adding an item, the item name is displayed as UnlocalizedName like the image. So, you will create ‘.lang file’ and give it an easy-to-understand LocalizedName.

the item name is displayed as UnlocalizedName

Because it is the same things to do in any language, I will do a tutorial with English as an example.

First of all, you create en_US.lang in the ‘lang package’.

:Right-click ‘lang package’
:New(N)
:Other(O)
:General, File, Next (N)
:Fill in the file name including the extension, and complete (F)
you create en_US.lang in the 'lang package'.

For items whose UnlocalizedName is ‘item_clay_chawan’, you write LocalizedName to en_US.lang as follows.

item.item_clay_chawan.name=Modeled clay_CHAWAN

you write LocalizedName to en_US.lang

Then UnlocalizedName will be replaced with LocalizedName written in en_US.lang.

UnlocalizedName will be replaced with LocalizedName

If you add LocalizedName to multiple items, you continue with the new line.

I think the list of GAMEPEDIA is easy to understand for the language and .lang file that Minecraft supports.

 

3. Item model and texture

The rendering of items in Minecraft is made up of the following 2 elements.

.json file Decide the model of the item. Put it in the ‘item package’.

In Chinjufu Mod, item and this link with RegistryName 

public static void registerRender(Item item) {
ModelLoader.setCustomModelResourceLocation(item, 0,
new ModelResourceLocation(item.getRegistryName(), “inventory“));
}

.png file Texture to paste on item model
Specify images and places to use in .json file.

There are 2 kinds of flat type and 3D type. However, in both cases you will use .json file and .png file to draw the item.

 

3-1. Flat type item rendering

For standard items in Minecraft, a texture is stuck on a plate model 16 × 16 × 1.

Flat type item rendering

About apple of Minecraft, its .json file is as follows.

apple.json

It means to paste the image written in “textures” on the model written in “parent”. When using flat type, you can draw by only changing “items/apple”.

The bauxite of Chinjufu MOD which uses a flat type wrote as follows.

item_bauxite.json

“items/apple” means apple.png in the textures/items package of vanilla. So, by rewriting “chinjufumod:items/bauxite”, I am calling bauxite.png in the textures/items package of chinjufumod.

 

By the way, chinjufumod is MOD ID.

by rewriting "chinjufumod:items/bauxite" calling bauxite.png in the textures/items package of chinjufumod

 

3-2. 3D type item rendering

It applies the rendering of item block. So, the details are explained by adding ItemBlock resources.

 

Summary

Adding item resources is the basic part of how to add resources.

・Tree structure of resource package
・Use UnlocalizedName to support multiple languages
・Linking RegistryName and .json file

Let’s understand these basics of resources.


このチュートリアルは参考になりましたか? シェアはこちらをご利用ください。
Was this tutorial helpful? Please use here for market share.

当サイトは年間6,480円のサーバー代がかかるため、投げ銭をしてもらえると助かります。
This site costs 6,480 yen per year for server fee. It will be helpful if you make a donation.

Bitcoinで投げ銭をする Bitcoin donations

¥
Personal Info

Terms

Donation Total: ¥100

MONAで投げ銭をする MONA donations
MONAで投げ銭をする MONA donations. tipmonaとは?

コメントを残す

メールアドレスが公開されることはありません。

コメント

お名前

ウェブサイトURL

このサイトはスパムを低減するために Akismet を使っています。コメントデータの処理方法の詳細はこちらをご覧ください