LevelReader

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.LevelReader;

Implemented Interfaces

LevelReader implements the following interfaces. That means all methods defined in these interfaces are also available in LevelReader

Methods

Return Type: boolean

script.zs
LevelReader.canSeeSkyFromBelowWater(pos as BlockPos) as boolean
ParameterType
Parameter
pos
Type
BlockPos

Gets the biome at a given position.

Returns: The biome at the given position.
Return Type: Biome

script.zs
// LevelReader.getBiome(pos as BlockPos) as Biome
myLevelReader.getBiome(new BlockPos(0, 1, 2));
ParameterTypeDescription
Parameter
pos
Type
BlockPos
Description
The position to look up.

Return Type: boolean

script.zs
LevelReader.hasChunk(x as int, z as int) as boolean
ParameterType
Parameter
x
Type
int
Parameter
z
Type
int

Checks if the block at a given position is empty.

Returns: Whether the block is empty.
Return Type: boolean

script.zs
// LevelReader.isEmptyBlock(pos as BlockPos) as boolean
myLevelReader.isEmptyBlock(new BlockPos(0, 1, 2));
ParameterTypeDescription
Parameter
pos
Type
BlockPos
Description
The position to look up.

Return Type: boolean

script.zs
LevelReader.isWaterAt(pos as BlockPos) as boolean
ParameterType
Parameter
pos
Type
BlockPos

Properties

NameTypeHas GetterHas SetterDescription
Name
isClientSide
Type
boolean
Has Getter
true
Has Setter
false
Description
Name
seaLevel
Type
int
Has Getter
true
Has Setter
false
Description
Gets the height of the sea level.
Name
skyDarken
Type
int
Has Getter
true
Has Setter
false
Description