BlockBreakContext

Information surrounding a block break event. Used to centralize block breaking logic so that BlockBreakEvent, BlockExplodeEvent, etc. can all be references by one interface rather than having to be dealt with individually.

Inheritors

Types

Link copied to clipboard

The block is being exploded as a result of another block exploding

Link copied to clipboard

The block is exploding (e.g. beds in the Nether/End, respawn anchors in the Overworld/End)

Link copied to clipboard
data class Burned(val event: BlockBurnEvent) : BlockBreakContext

The block has been burned away by fire

Link copied to clipboard
class Delete(val block: Block) : BlockBreakContext

The block is being forcefully broken by BlockStorage.deleteBlock

Link copied to clipboard

The block has been destroyed for another reason, such as a lever dropping because the block it was attached to was broken. It is not really documented exactly when the event that this relies on is actually fired for some reason.

Link copied to clipboard
data class EntityExploded(val block: Block, val event: EntityExplodeEvent) : BlockBreakContext

The block is being exploded by an entity (e.g. a creeper or TNT)

Link copied to clipboard
data class Faded(val event: BlockFadeEvent) : BlockBreakContext

The block has faded away (see BlockFadeEvent for more details)

Link copied to clipboard

The block is being broken by a player

Link copied to clipboard
class PluginBreak @JvmOverloads constructor(val block: Block, val normallyDrops: Boolean = true, val shouldSetToAir: Boolean = true) : BlockBreakContext

The block is being broken by a plugin

Properties

Link copied to clipboard
abstract val block: Block

The block that is about to be broken.

Link copied to clipboard
@get:JvmName(name = "normallyDrops")
abstract val normallyDrops: Boolean

Determines the default drop behavior of the context

Link copied to clipboard
@get:JvmName(name = "shouldSetToAir")
open val shouldSetToAir: Boolean

If true, the block will be set to air after the Pylon data is removed