LevelSimulatedRW

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

Implements

LevelSimulatedRW implements the following interfaces:

LevelWriter

Undocumented Interfaces

LevelSimulatedReader

Members

addFreshEntity(entity as Entity) as bool
add an entity to the world, return if the entity is added successfully.
script.zs
// LevelSimulatedRW.addFreshEntity(entity as Entity) as bool;
myLevelSimulatedRW.addFreshEntity(myEntity);

Parameters:

entity Type: Entity

Return Type: bool

destroyBlock(pos as BlockPos, doDrops as bool) as bool
Destroys a block within the world.

Returns: Whether the block was changed.

script.zs
// LevelSimulatedRW.destroyBlock(pos as BlockPos, doDrops as bool) as bool;
myLevelSimulatedRW.destroyBlock(new BlockPos(0, 1, 2), true);

Parameters:

pos Type: BlockPos - The position of the block.
doDrops Type: bool - Whether the block drops itself and it's loot.

Return Type: bool

destroyBlock(pos as BlockPos, doDrops as bool, breaker as Entity) as bool
Destroys a block within the world.

Returns: Whether the block was changed.

script.zs
// LevelSimulatedRW.destroyBlock(pos as BlockPos, doDrops as bool, breaker as Entity) as bool;
myLevelSimulatedRW.destroyBlock(new BlockPos(0, 1, 2), true, player);

Parameters:

pos Type: BlockPos - The position of the block.
doDrops Type: bool - Whether the block drops itself and it's loot.
breaker Type: Entity - The entity to break the block.

Return Type: bool