An IBlock Object consists of a IBlockDefinition, a metadata and a TileData.
It refers to a block in the game.

Importing the package

Link to importing-the-package

It might be required for you to import the package if you encounter any issues (like casting an Array), so better be safe than sorry and add the import.
import crafttweaker.block.IBlock;

Calling an IBlock Object

Link to calling-an-iblock-object

There are multiple ways thet return an IBlock object:

  • Casting a IItemStack as IBlock (using the AS keyword, or the asBlock() method)
  • Using the getBlock(x,y,z) on an IWorld.
  • Using getBlock() on ContentTweaker's ICTBlockState

Warning: Only using the second method is it possible for data ZenGetter to return a nonnull IData!

GetterWhat does it doReturn Type
Getter
definition
What does it do
Returns the Block's definition
Return Type
IBlockDefinition
Getter
meta
What does it do
Returns the Block's metadata
Return Type
int
Getter
data
What does it do
Returns the Block's tileData
Return Type
IData
Getter
fluid
What does it do
Returns the Block's fluid
Return Type
ILiquidDefinition

IBlocks extend IBlockPattern Objects. That means, all functions that are available to IBlockPattern objects can also be used for IBlock objects:

  • Use the blocks ZenGetter
  • OR'ing
  • Matching using the in keyword
  • Use the displayName ZenGetter