Block

open class Block(type: BlockType, pos: BlockPos, face: BlockFace?)

An immutable reference to a placed block in the world. It has a block type, a position, and optionally a specific face.

Constructors

Link copied to clipboard
fun Block(type: BlockType, pos: BlockPos, face: BlockFace? = null)

Functions

Link copied to clipboard
fun canBeHarvested(): Boolean

Checks whether the block can be mined with the tool in the player's hand

Link copied to clipboard
fun canBeHarvestedWith(item: Item): Boolean
Link copied to clipboard
fun getMetadata(): Int
Link copied to clipboard
fun getRedstoneStrength(): Int
Link copied to clipboard
fun getState(): IBlockState
Link copied to clipboard
fun isPowered(): Boolean
Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
fun withFace(face: BlockFace): Block

Narrows this block to reference a certain face. Used by Player.lookingAt to specify the block face being looked at.

Link copied to clipboard
fun withPos(pos: BlockPos): Block
Link copied to clipboard
fun withType(type: BlockType): Block

Properties

Link copied to clipboard
val face: BlockFace? = null
Link copied to clipboard
val pos: BlockPos
Link copied to clipboard
val type: BlockType
Link copied to clipboard
val x: Int
Link copied to clipboard
val y: Int
Link copied to clipboard
val z: Int

Inheritors

Link copied to clipboard

Sources

Link copied to clipboard