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.
import crafttweaker . api.world . CommonLevelAccessor;
CommonLevelAccessor
implements the following interfaces:
LevelReader
,LevelSimulatedRW
,BlockAndTintGetter
,BlockGetter
,LevelWriter
Undocumented Interfaces EntityGetter
, CollisionGetter
, SignalGetter
, NoiseBiomeSource
, IBlockAndTintGetterExtension
, LevelHeightAccessor
, IBlockGetterExtension
, LevelSimulatedReader
add an entity to the world, return if the entity is added successfully. // CommonLevelAccessor.addFreshEntity(entity as Entity) as bool;
myCommonLevelAccessor . addFreshEntity(myEntity);
Return Type:
bool
// CommonLevelAccessor.canSeeSkyFromBelowWater(pos as BlockPos) as bool;
myCommonLevelAccessor . canSeeSkyFromBelowWater(myBlockPos);
Return Type:
bool
Destroys a block within the world. Returns : Whether the block was changed.
// CommonLevelAccessor.destroyBlock(pos as BlockPos, doDrops as bool) as bool;
myCommonLevelAccessor . destroyBlock( new BlockPos( 0 , 1 , 2 ), true );
Parameters:
doDrops: bool
Type: bool
- Whether the block drops itself and it's loot.
Return Type:
bool
Destroys a block within the world. Returns : Whether the block was changed.
// CommonLevelAccessor.destroyBlock(pos as BlockPos, doDrops as bool, breaker as Entity) as bool;
myCommonLevelAccessor . destroyBlock( new BlockPos( 0 , 1 , 2 ), true , player);
Parameters:
doDrops: bool
Type: bool
- Whether the block drops itself and it's loot.
breaker: Entity
Type: Entity
- The entity to break the block.
Return Type:
bool
Gets the biome at a given position. Returns : The biome at the given position.
// CommonLevelAccessor.getBiome(pos as BlockPos) as Biome;
myCommonLevelAccessor . getBiome( new BlockPos( 0 , 1 , 2 ));
Return Type:
Biome
Gets the tile entity data for a tile entity at a given position. Returns : The data of the tile entity.
// CommonLevelAccessor.getBlockEntityData(pos as BlockPos) as IData;
myCommonLevelAccessor . getBlockEntityData( new BlockPos( 0 , 1 , 2 ));
Return Type:
IData
// CommonLevelAccessor.getBlockFloorHeight(pos as BlockPos) as double;
myCommonLevelAccessor . getBlockFloorHeight(myBlockPos);
Return Type:
double
Gets the block state at a given position. Returns : The block state at the position.
// CommonLevelAccessor.getBlockState(pos as BlockPos) as BlockState;
myCommonLevelAccessor . getBlockState( new BlockPos( 0 , 1 , 2 ));
Return Type:
BlockState
// CommonLevelAccessor.getLightEmission(pos as BlockPos) as int;
myCommonLevelAccessor . getLightEmission(myBlockPos);
Return Type:
int
// CommonLevelAccessor.hasChunk(x as int, z as int) as bool;
myCommonLevelAccessor . hasChunk(myInt, myInt);
Parameters:
x: int
Type: int
z: int
Type: int
Return Type:
bool
// CommonLevelAccessor.isClientSide as bool
myCommonLevelAccessor . isClientSide
Return Type:
bool
Checks if the block at a given position is empty. Returns : Whether the block is empty.
// CommonLevelAccessor.isEmptyBlock(pos as BlockPos) as bool;
myCommonLevelAccessor . isEmptyBlock( new BlockPos( 0 , 1 , 2 ));
Return Type:
bool
// CommonLevelAccessor.isWaterAt(pos as BlockPos) as bool;
myCommonLevelAccessor . isWaterAt(myBlockPos);
Return Type:
bool
// CommonLevelAccessor.maxLightLevel as int
myCommonLevelAccessor . maxLightLevel
Return Type:
int
Gets the height of the sea level. // CommonLevelAccessor.seaLevel as int
myCommonLevelAccessor . seaLevel
Return Type:
int
// CommonLevelAccessor.skyDarken as int
myCommonLevelAccessor . skyDarken
Return Type:
int