Tutorials/Programs and editors/Tectonicus/Custom Blocks

By default Tectonicus will render all the standard Minecraft blocks, but if you're using mods that add new block types then those blocks will be skipped. By making a custom block config you can add in custom block types to Tectonicus so that maps made with your favourite mods will show correctly.

Internally all blocks in Minecraft have a unique number, or id. You can see all of these here: Block_ids. Mods will add blocks by using block ids currently not in use - if you're a mod author then you can make a block config for others to use, or you can ask the mod author to document the new blocks and their ids.

Tutorial: Adding a simple custom block
First, you need to create a custom block file. An empty file looks like this:

 

Since this is xml, the extension is usually .xml, but this is not required. We'll save this to C:/customBlockConfig.xml.

Say you've got a mod that adds a 'cheese' block, made entirely out of hard cheese. It's a solid block (like dirt or stone) but has a yellow image on all sides. You'd add your cheese block so your config looks like this:



 

There are a few important things to notice:

* The 'Solid' tag means that this block is completely solid, like dirt. * The 'id' is the id of the block. * The 'name' is the name given to the block * The 'texture' is the image file to use. Png, gif or jpeg are supported.

Then you need to include your custom config when drawing your map. Find your config file, and add the config to the 'layer' tags as shown (the last two attributes are the new ones):



Render your map, and the new block should appear!

Replacing Existing Blocks
If you want to change how a regular Minecraft block looks, then you can just redefine it in your custom block. For example, if we changed the id above from 200 to 12 (the block id of sand) then all of your sand would appear as cheese.

Removing Existing Blocks
If you *only* want custom blocks then you can set 'useDefaultBlocks' to 'false'. This means that you don't get all of the regular Minecraft blocks. You could then use this to make a config containing *only* ores (coal, iron, gold, diamonds) to get a map of where they are under ground. This config would look like this:

     

The interesting thing to note here is the texture="terrain[0, 2]" bit. Minecraft block images are stored in a single big image called terrain.png (see Texture_pack). Here terrain[0, 2] means use the block image from terrain.png in the first column and third row (the place where gold ore is).

Using Images From A Texture Pack
Todo.