LevelWriter
Link to levelwriter
Importing the class
Link to 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.
ZenScript Copyimport crafttweaker.api.world.LevelWriter;
Methods
Link to methods
Name: addFreshEntity
add an entity to the world, return if the entity is added successfully.
Return Type: boolean
ZenScript CopyLevelWriter.addFreshEntity(entity as Entity) as boolean
Parameter | Type |
---|---|
Parameter entity | Type Entity |
Name: destroyBlock
Destroys a block within the world.
Returns: Whether the block was changed.
Return Type: boolean
ZenScript Copy// LevelWriter.destroyBlock(pos as BlockPos, doDrops as boolean) as boolean
myLevelWriter.destroyBlock(new BlockPos(0, 1, 2), true);
Parameter | Type | Description |
---|---|---|
Parameter pos | Type BlockPos | Description The position of the block. |
Parameter doDrops | Type boolean | Description Whether the block drops itself and it's loot. |
Name: destroyBlock
Destroys a block within the world.
Returns: Whether the block was changed.
Return Type: boolean
ZenScript Copy// LevelWriter.destroyBlock(pos as BlockPos, doDrops as boolean, breaker as Entity?) as boolean
myLevelWriter.destroyBlock(new BlockPos(0, 1, 2), true, player);
Parameter | Type | Description |
---|---|---|
Parameter pos | Type BlockPos | Description The position of the block. |
Parameter doDrops | Type boolean | Description Whether the block drops itself and it's loot. |
Parameter breaker | Type Entity? | Description The entity to break the block. |