Skip to main content

Module block

Module block 

Source
Expand description

The bus’s domains: each one’s actions as functions (world::get_block(dim, pos), entity::position(uuid), player::give_item(name, item, count)) beside its events. What happens to blocks.

Structs§

Bonemeal
Applies bone meal to the block.
Break
Fired when a player breaks a block (server side).
Destroy
Breaks the block (dropping it or not).
Info
The block’s state.
Insert
A hopper or dropper offers an item to a block that accepts items (block.accepts_items): a service each such block provides (keyed by its id), answering whether it takes the item.
InventorySlot
A container’s slot.
Nbt
A block entity’s data as SNBT.
Place
Fired when a player places a block (server side).
PourFluid
Empties a bucket at pos.
RedstonePower
The redstone power reaching the block; None without the dimension.
RedstoneSignal
The strongest signal the block gives out; None if it gives none.
SetInventorySlot
Sets a container’s slot.
SetNbt
Merges snbt into a block entity’s data.
SetRedstoneOutput
Sets a mod block’s redstone output.
SetState
Sets the block state at pos.
State
The block state at pos (minecraft:oak_log[axis=y]).
Use
Fired when a player right-clicks a block (server side).
UseItem
Uses item on a face of the block, as player would.

Functions§

bonemeal
Applies bone meal to the block.
destroy
Breaks the block (dropping it or not).
info
The block’s state.
inventory_slot
A container’s slot.
nbt
A block entity’s data as SNBT.
pour_fluid
Empties a bucket at pos.
property
Property name of the block at pos ("energized" → "true").
redstone_power
The redstone power reaching the block; None without the dimension.
redstone_signal
The strongest signal the block gives out; None if it gives none.
set_inventory_slot
Sets a container’s slot.
set_nbt
Merges snbt into a block entity’s data.
set_properties
Sets some properties of the block at pos ("energized=true,powered=false"), keeping the rest; false if there’s no block or the state doesn’t take.
set_redstone_output
Sets a mod block’s redstone output.
set_state
Sets the block state at pos.
state
The block state at pos (minecraft:oak_log[axis=y]).
use_item
Uses item on a face of the block, as player would.