BlockGetter

Importing the class

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 at the very top of the file.

script.zs
import crafttweaker.api.world.BlockGetter;

Methods

Gets the tile entity data for a tile entity at a given position.

Returns: The data of the tile entity.
Return Type: IData

script.zs
// BlockGetter.getBlockEntityData(pos as BlockPos) as IData
myBlockGetter.getBlockEntityData(new BlockPos(0, 1, 2));
ParameterTypeDescription
Parameter
pos
Type
BlockPos
Description
The position of the tile entity.

Return Type: double

script.zs
BlockGetter.getBlockFloorHeight(pos as BlockPos) as double
ParameterType
Parameter
pos
Type
BlockPos

Gets the block state at a given position.

Returns: The block state at the position.
Return Type: BlockState

script.zs
// BlockGetter.getBlockState(pos as BlockPos) as BlockState
myBlockGetter.getBlockState(new BlockPos(0, 1, 2));
ParameterTypeDescription
Parameter
pos
Type
BlockPos
Description
The position to look up.

Return Type: int

script.zs
BlockGetter.getLightEmission(pos as BlockPos) as int
ParameterType
Parameter
pos
Type
BlockPos

Properties

NameTypeHas GetterHas Setter
Name
maxLightLevel
Type
int
Has Getter
true
Has Setter
false