Advanced Modding - Block Materials

Goal

I want to show you the differences between the block materials that exist in Minecraft.

Difficulty

1/10 - Pretty simple

Prerequisites

Forge Version

This Tutorial was created with Forge 11.14.1.1334 for Minecraft 1.8. If anything doesn't work with other versions, please contact me!


The different block materials

The following is simply a list of every material and it's specifications. Use this to find the perfect material for your block.

Nearly every property a material has can be overridden using the methods from Block.class shown in the following table:

Property Function Method to override
flammability If true, the block can catch fire Property itself is not used. Override getFlammability(IBlockAccess, BlockPos, EnumFacing) to define the flammability as a value from 0 to 300. Override getFireSpreadSpeed(IBlockAccess, BlockPos, EnumFacing) to define the speed the fire spreads. Or use the method Blocks.fire.setFireInfo(Block, int spreadSpeed, int flammability) to set both values at once. Examples for values are in the class BlockFire.
replaceability If true, the block can be replaced when another block should be placed on it (like tall grass) Override isReplaceable(World, BlockPos).
translucent (better name: unstable, because it has nothing to do with lighting) If true, the block is not seen as a "normal cube", so it's sides are not solid (You can't place torches on them) Override isNormalCube(IBlockAccess, BlockPos) or isSideSolid(IBlockAccess, BlockPos, EnumFacing).
solidity If true, the block is considered solid. Override isBlockSolid(IBlockAccess, BlockPos, EnumFacing).
map color Defines the color of a block visible on a map. Override getMapColor(IBlockState).
no tool requirement If true, the block drops an item even if no or the wrong tool is used. Not changeable, unless you're defining special block drops based on the tool (see Block dropping special Item).
mobility

If 0, the block can be pushed normally.

If 1, the block drops when being pushed.

If 2, the block can't be pushed.

Override getMobilityFlag().
adventure mode exempt

If true, the block can be mined without a tool in adventure mode.

This property is unused. It has no effect on the block's behaviour.
blocks light

If false, the block is considered translucent in rendering

Override isTranslucent(). Be careful, this method is marked as Client Side only. You'll probably need to add the Annotation @SideOnly(Side.CLIENT). Never use this method from server side. Server side alternative is getLightOpacity(IBlockAccess, BlockPos), but this is not independend from this property.


And now: Lets start the material list.

The materials

The materials can be accessed using Material.anyMaterial.

 

Material Specifications
air
  • Transparent color
  • not flammable
  • replaceable
  • translucent / not solid
  • does not block light
  • Only used for air blocks
grass
  • Grass color
  • not flammable
  • not replaceable
  • not translucent
  • solid
  • requires no tool
  • can be pushed normally
  • blocks light
  • Used for grass, hay and mycelium
ground
  • Dirt color
  • not flammable
  • not replaceable
  • not translucent
  • solid
  • requires no tool
  • can be pushed normally
  • blocks light
  • Used for dirt and farmland
wood
  • Wood color
  • flammable
  • not replaceable
  • not translucent
  • solid
  • requires no tool
  • can be pushed normally
  • blocks light
  • Used for everything made from wood like wood itself, chests, banners, ...
rock
  • Stone color
  • not flammable
  • not replaceable
  • not translucend
  • solid
  • requires tools
  • can be pushed normally
  • blocks light
  • Used for nearly everything that needs a pickaxe.
iron
  • Iron color
  • not flammable
  • not replaceable
  • not translucend
  • solid
  • requires tools
  • can be pushed normally
  • blocks light
  • Used for iron blocks, doors, bars, pressure plates and trapdoors, as well as for command blocks.
anvil
  • Iron color
  • not flammable
  • not replaceable
  • not translucend
  • solid
  • requires tools
  • cannot be pushed
  • blocks light
  • Used for iron blocks, doors, bars, pressure plates and trapdoors, as well as for command blocks.
water
  • Water color
  • not flammable
  • replaceable
  • translucent
  • not solid
  • can be moved over by pistons
  • doesn't block light
  • marked as liquid
  • Used for water.
lava
  • TNT color
  • not flammable
  • replaceable
  • translucent
  • not solid
  • can be moved over by pistons
  • doesn't block light
  • marked as liquid
  • Used for lava.
leaves
  • Foliage color
  • flammable
  • not replaceable
  • translucent
  • not solid
  • requires no tool
  • can be moved over by pistons
  • blocks light
  • Used for leaves.
plants
  • Foliage color
  • not flammable (remember, this property is unused!)
  • not replaceable
  • not translucent
  • not solid
  • requires no tool
  • can be moved over by pistons
  • doesn't block light
  • Used for plants.
vine
  • Foliage color
  • flammable
  • replaceable
  • not translucent
  • not solid
  • requires no tool
  • can be moved over by pistons
  • doesn't block light
  • Used for vines.
sponge
  • Cloth color
  • not flammable
  • not replaceable
  • not translucent
  • solid
  • requires no tool
  • can be pushed normally
  • blocks light
  • Used for sponges.
cloth
  • Cloth color
  • flammable
  • not replaceable
  • not translucent
  • solid
  • requires no tool
  • can be pushed normally
  • blocks light
  • Used for wool and beds.
fire
  • Transparent color
  • not flammable
  • replaceable
  • translucent / not solid
  • does not block light
  • Only used for fire blocks.
  • (Similar to air)
sand
  • Sand color
  • not flammable
  • not replaceable
  • not translucent
  • solid
  • requires no tool
  • can be pushed normally
  • blocks light
  • Used for sand.
circuits
  • Transparent color
  • not flammable
  • not replaceable
  • translucent
  • not solid
  • requires no tool
  • can be moved over by pistons
  • doesn't block light
  • Used for everything with redstone. Also, buttons, ladders, skulls, torches and rails use the material.
carpet
  • Cloth color
  • flammable
  • not replaceable
  • translucent
  • not solid
  • requires no tool
  • can be pushed normally
  • doesn't block light
  • Used for carpets.
glass
  • Transparent color
  • not flammable
  • not replaceable
  • translucent
  • solid
  • requires no tool
  • can be pushed normally
  • blocks light (probably overridden anywhere)
  • Used for glass and stained glass.
redstoneLight
  • Transparent color
  • not flammable
  • not replaceable
  • not translucent
  • solid
  • requires no tool
  • can be pushed normally
  • blocks light
  • Used for redstone lamps.
tnt
  • TNT color
  • flammable
  • not replaceable
  • translucent (remember: this means, it's sides are not solid)
  • solid
  • requires no tool
  • can be pushed normally
  • blocks light
  • Used for TNT.
coral
  • Foliage color
  • not flammable
  • not replaceable
  • not translucent
  • solid
  • requires no tool
  • can be pushed normally
  • blocks light
  • Not used at all.
ice
  • Ice color
  • not flammable
  • not replaceable
  • translucent
  • solid
  • requires no tool
  • can be pushed normally
  • blocks light
  • Used for ice.
packedIce
  • Ice color
  • not flammable
  • not replaceable
  • not translucent
  • solid
  • requires no tool
  • can be pushed normally
  • blocks light
  • Used for packed ice.
snow
  • Snow color
  • not flammable
  • replaceable
  • translucent
  • not solid
  • requires tools
  • can be moved over by pistons
  • doesn't block light
  • Used for snow layers.
craftedSnow
  • Snow color
  • not flammable
  • not replaceable
  • not translucent
  • solid
  • requires tools
  • can be pushed normally
  • blocks light
  • Used for snow blocks.
cactus
  • Foliage color
  • not flammable
  • not replaceable
  • translucent
  • solid
  • requires no tool
  • can be moved over by pistons
  • blocks light
  • Used by cacti.
clay
  • Clay color
  • not flammable
  • not replaceable
  • not translucent
  • solid
  • requires no tool
  • can be pushed normally
  • blocks light
  • Used for clay.
gourd
  • Foliage color
  • not flammable
  • not replaceable
  • not translucent
  • solid
  • requires no tool
  • can be moved over by pistons
  • blocks light
  • Used by melons and pumpkins.
dragonEgg
  • Foliage color
  • not flammable
  • not replaceable
  • not translucent
  • solid
  • requires no tool
  • can be moved over by pistons
  • blocks light
  • Used by the dragonEgg.
portal
  • Transparent color
  • not flammable
  • not replaceable
  • not translucent
  • not solid
  • requires no tool
  • cannot be moved by pistons
  • doesn't block light
  • Used by portals.
cake
  • Transparent color
  • not flammable
  • not replaceable
  • not translucent
  • solid
  • requires no tool
  • can be moved over by pistons
  • blocks light
  • Used by cakes.
web
  • Cloth color
  • not flammable
  • not replaceable
  • not translucent
  • not solid
  • requires tools
  • cannot be pushed normally
  • blocks light
  • Used by cobwebs.
piston
  • Stone color
  • not flammable
  • not replaceable
  • not translucend
  • solid
  • requires no tool
  • cannot be pushed by pistons
  • blocks light
  • Used for pistons.
barrier
  • Transparent color
  • not flammable
  • not replaceable
  • not translucend
  • solid
  • requires tools
  • cannot be pushed by pistons
  • blocks light
  • Used for barriers.

 

It is possible, to create new Materials, but mostly it's useful to choose a standard material and add additional features by overriding special block methods.

Personally I think, the materials are a good idea, but they are not done well, because some properties are unused and several materials are basically the same.

I hope, you can decide now which material you want to use for your blocks.


Recommended tutorials to continue with

Take a look at the tutorial overview and decide what you want to do next.


Comments and Questions:

If you want to report modding problems, please make sure to include the code in a pastebin link or something else! Don't just write "It doesn't work", otherwise your post will be deleted. For more complicated problems, please use the troubleshooter form.