Modding:Basic Block: Difference between revisions
CreativeMD (talk | contribs) |
CreativeMD (talk | contribs) No edit summary |
||
Line 34: | Line 34: | ||
} | } | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Now navigate to the [[Vintagestory folder]] again and place the json file inside it in <code>assets\assets\blocktypes\metal\</code>. | |||
== Testing == | == Testing == | ||
Finally we got everything ready to run our first test. Therefore start Vintagestory as usual, you should be able to find your added block inside the creative inventory. | |||
[[File:2017-01-10 12-33-45.png|700px]]. | |||
== Translations == | |||
== Export a mod == | == Export a mod == | ||
= Advanced Properties = | = Advanced Properties = |
Revision as of 11:42, 10 January 2017
This tutorial should introduce you into the basic of adding a block to the game using JSON files. Down below you can find a complete list of all existing properties. If your block requires more than just a JSON file there is a tutorial for Advanced Blocks. There is a full list of all properties which can be defined inside the json file Block Json Properties.
A Simple Block
Let's add a simple block to the game. In our example we will add a new wooden planks type.
The Texture
First of all we need a texture. We will add a gold block to the game using this texture: .
Now we need to copy the texture to the game assets. Therefore navigate to the Vintagestory folder and place it in assets\textures\blocks\wood\planks\
. Eventually rename it to mygoldtexture.png
The JSON file
Now we need a json file which will determine the properties this block has. For now we keep it simple and only cover simple properties, but there are a lot of other things you can do with. Here is a full list of all Block Json Properties. So create a new json file in your editor (we highly recommend to use Notepad++ or Visual Studio) named mygoldblock.json
.
{
code: "mygoldblock",
creativeinventory: { "default": ["*"] },
shape: { base: "basic/cube" },
blockmaterial: "Stone",
drawtype: "cube",
textures: {
all: { base: "metal/mygoldtexture" }
},
resistance: 3.5,
sounds: {
"place": "block/anvil",
"walk": "walk/stone"
}
}
Now navigate to the Vintagestory folder again and place the json file inside it in assets\assets\blocktypes\metal\
.
Testing
Finally we got everything ready to run our first test. Therefore start Vintagestory as usual, you should be able to find your added block inside the creative inventory.