Guide 1 Docs 2 Reference 3
11

BlockAmendSpec type

What game.blocks.amend takes: **hooks only**. Every tnt in every world already looks like tnt and is as hard as tnt, so a data column here is refused by name. For a block of your own with different numbers, game.blocks.define { extends = "tnt" }.

Functions 11

blockAmendSpec.on_use((block: BlockAt, player: Player?, held: string?, base: (...any) -> any) -> Used?) → ?

Somebody right-clicked it; held is the item in hand. Answers "used" or "pass"; a missed deadline passes the click through.

blockAmendSpec.on_break((block: BlockAt, player: Player?, by: Breaker, base: (...any) -> any) -> Drops?) → ?

Something broke it; by says what. Answers "none", "table" or a drops list.

blockAmendSpec.on_step((block: BlockAt, body: Body, base: (...any) -> any) -> ()) → ?

A body (a player, mob, item or other) is standing on it.

blockAmendSpec.on_tick((block: BlockAt, base: (...any) -> any) -> ()) → ?

A scheduled tick this block asked for came due.

blockAmendSpec.on_random_tick((block: BlockAt, base: (...any) -> any) -> ()) → ?

The random pass landed on it.

blockAmendSpec.on_place((block: BlockAt, player: Player?, base: (...any) -> any) -> ()) → ?

A player put it down.

blockAmendSpec.on_neighbour((block: BlockAt, from: Vec3, announced: string, base: (...any) -> any) -> ()) → ?

A neighbour at from changed; announced is the block the notifier announced itself as.

blockAmendSpec.on_trigger((block: BlockAt, cause: Trigger, base: (...any) -> any) -> ()) → ?

It was lit, blasted or burnt; cause is "ignite", "explosion" or "fire".

blockAmendSpec.on_power((block: BlockAt, powered: boolean, base: (...any) -> any) -> ()) → ?

A redstone signal started (powered is true) or stopped reaching it. Called once for each, not for every change beside it.

blockAmendSpec.on_added((block: BlockAt, base: (...any) -> any) -> ()) → ?

It has just been stored, whatever stored it.

blockAmendSpec.on_removed((block: BlockAt, base: (...any) -> any) -> ()) → ?

It has just gone.