LevelAccessor
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.
import crafttweaker.api.world.LevelAccessor;Implements
LevelAccessor
implements the following interfaces:
CommonLevelAccessor,LevelReader,LevelSimulatedRW,BlockAndTintGetter,BlockGetter,LevelWriter
Undocumented Interfaces
LevelTimeAccess,EntityGetter,CollisionGetter,SignalGetter,NoiseBiomeSource,IBlockAndTintGetterExtension,LevelHeightAccessor,IBlockGetterExtension,LevelSimulatedReader
Members
Returns: Whether the block was changed.
myLevelAccessor.destroyBlock(new BlockPos(0, 1, 2), true);Parameters:
Return Type:
bool
Returns: Whether the block was changed.
myLevelAccessor.destroyBlock(new BlockPos(0, 1, 2), true, player);Parameters:
Return Type:
bool
// LevelAccessor.difficulty as DifficultymyLevelAccessor.difficulty
Return Type:
Difficulty
Returns: The data of the tile entity.
myLevelAccessor.getBlockEntityData(new BlockPos(0, 1, 2));
Return Type:
IData
Returns: The block state at the position.
myLevelAccessor.getBlockState(new BlockPos(0, 1, 2));
Return Type:
BlockState
myLevelAccessor.getCurrentDifficultyAt(myBlockPos);
Return Type:
DifficultyInstance
// LevelAccessor.hasChunk(x as int, z as int) as bool;myLevelAccessor.hasChunk(myInt, myInt);Parameters:
x: int Type: int z: int Type: int
Return Type:
bool
// LevelAccessor.isClientSide as boolmyLevelAccessor.isClientSide
Return Type:
bool
myLevelAccessor.levelEvent(player, myInt, myBlockPos, myInt);Parameters:
myLevelAccessor.levelEvent(myInt, myBlockPos, myInt);// LevelAccessor.maxLightLevel as intmyLevelAccessor.maxLightLevel
Return Type:
int
// LevelAccessor.playSound(player as Player, position as BlockPos, event as SoundEvent, source as SoundSource);myLevelAccessor.playSound(myPlayer, myBlockPos, mySoundEvent, mySoundSource);Parameters:
event: SoundEvent Type: SoundEvent source: SoundSource Type: SoundSource // LevelAccessor.playSound(player as Player, position as BlockPos, event as SoundEvent, source as SoundSource, volume as float, pitch as float);myLevelAccessor.playSound(myPlayer, myBlockPos, mySoundEvent, mySoundSource, myFloat, myFloat);Parameters:
event: SoundEvent Type: SoundEvent source: SoundSource Type: SoundSource volume: float Type: float pitch: float Type: float // LevelAccessor.random as RandomSourcemyLevelAccessor.random
Return Type:
RandomSource
// LevelAccessor.seaLevel as intmyLevelAccessor.seaLevel
Return Type:
int
// LevelAccessor.skyDarken as intmyLevelAccessor.skyDarken
Return Type:
int