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

Attenzione: Solo usando il secondo metodo è possibile che i dati `` ZenGetter restituiscano un IData non nulla!

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 estende IBlockPattern Objects. Ciò significa che tutte le funzioni disponibili per gli oggetti IBlockPattern possono essere utilizzate anche per gli oggetti IBlock:

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