Confirmedusers, editor, Administrators
886
edits
CreativeMD (talk | contribs) No edit summary |
CreativeMD (talk | contribs) No edit summary |
||
Line 1: | Line 1: | ||
__FORCETOC__ | __FORCETOC__ | ||
This tutorial should introduce you into the basic of adding an item to the game using JSON files. If you want to add a | This tutorial should introduce you into the basic of adding an item to the game using JSON files. If you want to add a item with functionality you should check out the tutorial for [[Advanced Items]]. There is a full list of all properties which can be defined inside the json file [[Item Json Properties]]. Adding a block to the game is rather similar, so if you have done that already most of the following steps should already be known to you. | ||
= A Simple Item = | = A Simple Item = | ||
Line 14: | Line 14: | ||
Now we need to let the game know if its existence. We can accomplish that by creating a json file and placing it inside <code>assets/itemtypes/tool/wand.json</code>. | Now we need to let the game know if its existence. We can accomplish that by creating a json file and placing it inside <code>assets/itemtypes/tool/wand.json</code>. | ||
The content of this json file should look as it follows: | |||
<syntaxhighlight lang="json"> | |||
{ | |||
code: "wand", | |||
creativeinventory: { "default": ["*"] }, | |||
texture: { base: "tool/wand/wand" } | |||
} | |||
</syntaxhighlight> | |||
* '''code''': A unique identifier for your item. If you plan a larger mod, it is suggested to prefix your modname to the identifier. | |||
* '''creativeinventory''': The creative inventory tabs the itemshould be shown in (currently only 1 tab available) | |||
* '''textures''': What textures to apply. | |||
== Testing == | == Testing == | ||
Now we got everything ready to run our first test. You should be able to find the added item in the creative inventory. | |||
[[File:2017-01-30 13-59-27.png|700px]] | |||
== Naming the Item == | == Naming the Item == | ||
To give the item a proper name, you currently have to manually add a line like this in the file <code>assets/lang/en.json</code> | |||
<syntaxhighlight lang="json"> | |||
"item-wand": "Wand", | |||
</syntaxhighlight> | |||
A better way of handling naming and translation will be added once its desired. | |||
== Distributing a mod == | == Distributing a mod == | ||
The current modding system does not yet support mod-specific asset folders. The current way of doing it is to create a zip file a user can extract into his game folder that will extract the files into the right folders. Example: | |||
[[File:MyWandMod.zip]] | |||
A proper mod manager will be added to the game once there is a few serious mods out there (go bug tyron about it ;-) ). | |||
= Advanced Properties = | = Advanced Properties = |