Default

class Default(hardness: Provider<Double>, toolCategories: Provider<Set<ToolCategory>>, toolTier: Provider<ToolTier?>, requiresToolForDrops: Provider<Boolean>, breakParticles: Provider<Material?>, showBreakAnimation: Provider<Boolean>) : Breakable

Default implementation of Breakable.

Constructors

Link copied to clipboard
constructor(hardness: Provider<Double>, toolCategories: Provider<Set<ToolCategory>>, toolTier: Provider<ToolTier?>, requiresToolForDrops: Provider<Boolean>, breakParticles: Provider<Material?>, showBreakAnimation: Provider<Boolean>)

Properties

Link copied to clipboard
open override val breakParticles: Material?

The type of break particles to spawn in case the block is entity-backed or model-less with no vanilla particles.

Link copied to clipboard
open override val hardness: Double

The hardness of the block. Higher values mean the block takes longer to break.

Link copied to clipboard
open override val requiresToolForDrops: Boolean

Whether the block requires a tool to drop its item.

Link copied to clipboard
open override val showBreakAnimation: Boolean

Whether the break animation should be shown.

Link copied to clipboard
open override val toolCategories: Set<ToolCategory>

The ToolCategories required to break the block. If empty, no specific tool is required.

Link copied to clipboard
open override val toolTier: ToolTier?

The ToolTier required to break the block. Can be null to not require a specific tool tier.

Functions

Link copied to clipboard

Checks whether a block of state can be placed at pos using the given ctx.

Link copied to clipboard

Retrieves the items that would be dropped when breaking a block of state at pos with the given ctx. Handlers should check DefaultContextParamTypes.BLOCK_DROPS and DefaultContextParamTypes.BLOCK_STORAGE_DROPS.

Link copied to clipboard

Retrieves the amount of experience that would be dropped when breaking a block of state at pos with the given ctx. Handlers should check DefaultContextParamTypes.BLOCK_EXP_DROPS.

Link copied to clipboard

Handles attack (left-click) on a block of state at pos with the given ctx.

Link copied to clipboard

Handles the destruction of a block of state at pos with the given ctx.

Link copied to clipboard
open fun handleEntityInside(pos: BlockPos, state: NovaBlockState, entity: Entity)

Called when an entity is inside a block of state at pos.

Link copied to clipboard

Handles interaction (right-click) with a block of state at pos with the given ctx.

Link copied to clipboard

Called when a redstone update happened that may affect this state at pos.

Link copied to clipboard

Handles the placement of a block of state at pos with the given ctx.

Link copied to clipboard

Handles a random tick for a block of state at pos.

Link copied to clipboard

Handles a scheduled tick for a block of state at pos.

Link copied to clipboard

Chooses the ItemStack that should be given to the player when mid-clicking a block of state at pos with the given ctx in creative mode.

Link copied to clipboard

Whether this behavior implements random-tick logic for the given state. Note that the result of this method will be cached on startup.

Link copied to clipboard
open fun updateShape(pos: BlockPos, state: NovaBlockState, neighborPos: BlockPos): NovaBlockState

Called when a block at neighborPos changed to update the NovaBlockState of this state at pos.