Modding:Basic Block: Difference between revisions
CreativeMD (talk | contribs) No edit summary |
CreativeMD (talk | contribs) No edit summary |
||
Line 17: | Line 17: | ||
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]]. | 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]]. | ||
< | <syntaxhighlight> | ||
{ | { | ||
code: "myspecialplanks", | code: "myspecialplanks", | ||
Line 34: | Line 33: | ||
} | } | ||
} | } | ||
</ | </syntaxhighlight> | ||
== Testing == | == Testing == |
Revision as of 09:22, 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 spruce wood plank to the game using this texture: File:Spruce1.png.
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 ourtexture.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.
{
code: "myspecialplanks",
creativeinventory: { "default": ["*"] },
shape: { base: "basic/cube" },
blockmaterial: "Wood",
drawtype: "cube",
textures: {
all: { base: "wood/planks/ourtexture.png" }
},
resistance: 3.5,
sounds: {
"place": "block/planks",
"walk": "walk/wood"
}
}