Minecraft renders Blocks in different ways depending on the type of the block (see diagram below).
- Standard blocks (full cubes) can all be drawn the same way -i.e. using a square texture for each of the six sides. More Info
- Unusual blocks in vanilla minecraft (eg doors, pistons, bed, etc) are rendered using the corresponding .renderBlock#### method in RenderBlocks, for example renderBlockBed().
- Forge has added a hook for rendering custom blocks. If you create a new type of Block which needs special rendering, you need to define a custom renderer class for it:
- Create a class MyRenderer which implements ISimpleBlockRenderingHandler.
- Assign it a myRenderID using RenderingRegistry.getNextAvailableRenderID()
- Register myRenderer with RenderingRegistry.registerBlockHandler().
- Ensure your myBlock.getRenderType() returns myRenderID.
- Put your custom rendering code in MyRenderer.renderWorldBlock().
One of the trickier parts of rendering custom blocks can be figuring out the folder where you need to place your custom icons. For block textures this is in your resources root folder under
In my case, during development this was (eg)C:\Documents and Settings\TheGreyGhost\My Documents\IDEAprojects\MyTestFolder\src\main\resources\assets\testitemrendering\textures\blocks\myIcon.png
A note about rendering animated Blocks:When rendering Blocks, minecraft uses a 'cached renderlist' that is only refreshed when the block changes. So if you try to animate your Block using the Block rendering methods above, you won't see anything until the Block is changed or updated.
If you want your Block to be animated, you need to either use an animated texture for your Block, or use a TileEntity with TileEntitySpecialRender.