BlockSounds

class BlockSounds(soundGroup: Provider<SoundGroup>) : BlockBehavior

Adds sound to a block.

Parameters

soundGroup

The sound group to be used.

Constructors

Link copied to clipboard
constructor(soundGroup: Provider<SoundGroup>)
constructor(soundGroup: SoundGroup)

Adds sound to a block.

Properties

Link copied to clipboard

The sound group.

Functions

Link copied to clipboard
open suspend fun canPlace(pos: BlockPos, state: NovaBlockState, ctx: Context<BlockPlace>): Boolean

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

Link copied to clipboard
open fun getDrops(pos: BlockPos, state: NovaBlockState, ctx: Context<BlockBreak>): List<ItemStack>

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

Link copied to clipboard
open fun getExp(pos: BlockPos, state: NovaBlockState, ctx: Context<BlockBreak>): Int

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

Link copied to clipboard
open fun handleAttack(pos: BlockPos, state: NovaBlockState, ctx: Context<BlockBreak>)

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

Link copied to clipboard
open fun handleBreak(pos: BlockPos, state: NovaBlockState, ctx: Context<BlockBreak>)

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

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

Link copied to clipboard
open fun handlePlace(pos: BlockPos, state: NovaBlockState, ctx: Context<BlockPlace>)

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
open fun pickBlockCreative(pos: BlockPos, state: NovaBlockState, ctx: Context<BlockInteract>): ItemStack?

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.

Link copied to clipboard

Uses the block of state at pos by itself, without using an item.

Link copied to clipboard

Uses an item on the block of state at pos.