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

Advertencia: ¡Sólo usar el segundo método es posible que data ZenGetter devuelva un ID no null!

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

Los IBlocks extienden Objetos IBlockPattern. Esto significa que todas las funciones que están disponibles para los objetos IBlockPattern también pueden utilizarse para objetos de IBlock:

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