LevelReader

Importing the class

If you need to reference this type directly, like when casting an Array, or as a parameter, you will need to import it. Simply add the import at the top of the file.

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

Implements

LevelReader implements the following interfaces:

BlockAndTintGetter,BlockGetter

Undocumented Interfaces

CollisionGetter,SignalGetter,NoiseBiomeSource,IBlockAndTintGetterExtension,LevelHeightAccessor,IBlockGetterExtension

Members

canSeeSkyFromBelowWater(pos as BlockPos) as bool
script.zs
// LevelReader.canSeeSkyFromBelowWater(pos as BlockPos) as bool;
myLevelReader.canSeeSkyFromBelowWater(myBlockPos);

Parameters:

pos Type: BlockPos

Return Type: bool

getBiome(pos as BlockPos) as Biome
Gets the biome at a given position.

Returns: The biome at the given position.

script.zs
// LevelReader.getBiome(pos as BlockPos) as Biome;
myLevelReader.getBiome(new BlockPos(0, 1, 2));

Parameters:

pos Type: BlockPos - The position to look up.

Return Type: Biome

getBlockEntityData(pos as BlockPos) as IData
Gets the tile entity data for a tile entity at a given position.

Returns: The data of the tile entity.

script.zs
// LevelReader.getBlockEntityData(pos as BlockPos) as IData;
myLevelReader.getBlockEntityData(new BlockPos(0, 1, 2));

Parameters:

pos Type: BlockPos - The position of the tile entity.

Return Type: IData

getBlockFloorHeight(pos as BlockPos) as double
script.zs
// LevelReader.getBlockFloorHeight(pos as BlockPos) as double;
myLevelReader.getBlockFloorHeight(myBlockPos);

Parameters:

pos Type: BlockPos

Return Type: double

getBlockState(pos as BlockPos) as BlockState
Gets the block state at a given position.

Returns: The block state at the position.

script.zs
// LevelReader.getBlockState(pos as BlockPos) as BlockState;
myLevelReader.getBlockState(new BlockPos(0, 1, 2));

Parameters:

pos Type: BlockPos - The position to look up.

Return Type: BlockState

getLightEmission(pos as BlockPos) as int
script.zs
// LevelReader.getLightEmission(pos as BlockPos) as int;
myLevelReader.getLightEmission(myBlockPos);

Parameters:

pos Type: BlockPos

Return Type: int

hasChunk(x as int, z as int) as bool
script.zs
// LevelReader.hasChunk(x as int, z as int) as bool;
myLevelReader.hasChunk(myInt, myInt);

Parameters:

x Type: int
z Type: int

Return Type: bool

Getter
script.zs
// LevelReader.isClientSide as bool
myLevelReader.isClientSide

Return Type: bool

isEmptyBlock(pos as BlockPos) as bool
Checks if the block at a given position is empty.

Returns: Whether the block is empty.

script.zs
// LevelReader.isEmptyBlock(pos as BlockPos) as bool;
myLevelReader.isEmptyBlock(new BlockPos(0, 1, 2));

Parameters:

pos Type: BlockPos - The position to look up.

Return Type: bool

isWaterAt(pos as BlockPos) as bool
script.zs
// LevelReader.isWaterAt(pos as BlockPos) as bool;
myLevelReader.isWaterAt(myBlockPos);

Parameters:

pos Type: BlockPos

Return Type: bool

Getter
script.zs
// LevelReader.maxLightLevel as int
myLevelReader.maxLightLevel

Return Type: int

Getter
Gets the height of the sea level.
script.zs
// LevelReader.seaLevel as int
myLevelReader.seaLevel

Return Type: int

Getter
script.zs
// LevelReader.skyDarken as int
myLevelReader.skyDarken

Return Type: int