BlockEditor

interface BlockEditor

Interface for editing block properties in a DSL-style manner.

This interface provides a fluent API for modifying blocks in the world. It is designed to be used within a DSL context, typically within a lambda passed to a world or location editing function.

Example usage:

// Basic block type change
blockEditor {
type = Material.DIAMOND_BLOCK
}

// Modifying block data
blockEditor {
type = Material.CHEST
blockData = (blockData as Directional).apply {
facing = BlockFace.NORTH
}
}

// Dropping items
blockEditor {
dropItem(ItemStack(Material.DIAMOND, 5))
type = Material.AIR
}

Properties

Link copied to clipboard
abstract val block: Block

The underlying Bukkit Block being edited.

Link copied to clipboard
abstract var blockData: BlockData

The block data containing additional state information.

Link copied to clipboard
abstract var type: Material

The material type of the block.

Functions

Link copied to clipboard
abstract fun dropItem(itemStack: ItemStack)

Drops an item naturally at the block's location.