Translations:Modding:Content Tutorial Simple Block/13/en

From Vintage Story Wiki

The most important property when creating an asset is the code, also known as an ID. To begin, copy and paste this into the opened simpleshinyblock file.

{
  "code": "simplegoldblock"
}

Remember that json files are a set of keys to values. The key, in this example, is "code", and the value is "simplegoldblock". Note that the block file starts and ends in curly brackets ({ }), meaning it is a single object. Now that your block file has a code, it will now be created and registered in game. However, you need a way of accessing the block. To do this, add a new property:

{
  "code": "simplegoldblock",
  "creativeinventory": { "general": [ "*" ] },
}

Notice that each property is seperated using a comma. The new property, "creativeinventory" tells the game what creative tab this block will be placed in. The syntax of this particular property is a little bit more complex, but don't worry about it for now. All this does is add the block into the "general" creative tab.