Fluid handler
This commit is contained in:
@@ -59,20 +59,21 @@ component.
|
||||
|
||||
## Handlers
|
||||
|
||||
| Handler | Called when | Returns |
|
||||
| --------------------------------------------- | --------------------------------------------------------------------------------------------------- | -------------------------- |
|
||||
| `on_create(block, params)` | The block is placed or set, by a player or a script. | |
|
||||
| `on_break(block, params, player?)` | The block is broken or replaced. `player` when a player broke it. | |
|
||||
| `on_click(block, params, player)` | A player starts hitting it. | |
|
||||
| `on_interact(block, params, player)` | A player right clicks it. | `true` if it did something |
|
||||
| `on_scroll(block, params, player, scroll)` | A player turns the mouse wheel looking at it. See [Scrolling](#scrolling). | |
|
||||
| `on_tick(block, params, dt)` | Every tick, 20 times a second, near a player. | |
|
||||
| `on_second(block, params, dt)` | Every second, near a player. | |
|
||||
| `on_new_day(block, params, day)` | Every morning at 06:00. See [Ticking](#ticking) for where. | |
|
||||
| `on_neighbor_change(block, params, neighbor)` | A block on one of its 6 sides is placed, broken or changes its states. See [Changes](#changes). | |
|
||||
| `on_state_change(block, params, before)` | Its own states change without it being replaced, by `set_state` or a rule. See [Changes](#changes). | |
|
||||
| `on_scheduled_tick(block, params)` | A tick it asked for comes. See [Scheduled Ticks](#scheduled-ticks). | |
|
||||
| `on_entity_stand(block, params, entity)` | An entity standing on it moves, every tick it does. See [Entities on It](#entities-on-it). | |
|
||||
| Handler | Called when | Returns |
|
||||
| --------------------------------------------- | --------------------------------------------------------------------------------------------------------- | -------------------------------- |
|
||||
| `on_create(block, params)` | The block is placed or set, by a player or a script. | |
|
||||
| `on_break(block, params, player?)` | The block is broken or replaced. `player` when a player broke it. | |
|
||||
| `on_click(block, params, player)` | A player starts hitting it. | |
|
||||
| `on_interact(block, params, player)` | A player right clicks it. | `true` if it did something |
|
||||
| `on_scroll(block, params, player, scroll)` | A player turns the mouse wheel looking at it. See [Scrolling](#scrolling). | |
|
||||
| `on_tick(block, params, dt)` | Every tick, 20 times a second, near a player. | |
|
||||
| `on_second(block, params, dt)` | Every second, near a player. | |
|
||||
| `on_new_day(block, params, day)` | Every morning at 06:00. See [Ticking](#ticking) for where. | |
|
||||
| `on_neighbor_change(block, params, neighbor)` | A block on one of its 6 sides is placed, broken or changes its states. See [Changes](#changes). | |
|
||||
| `on_state_change(block, params, before)` | Its own states change without it being replaced, by `set_state` or a rule. See [Changes](#changes). | |
|
||||
| `on_scheduled_tick(block, params)` | A tick it asked for comes. See [Scheduled Ticks](#scheduled-ticks). | |
|
||||
| `on_entity_stand(block, params, entity)` | An entity standing on it moves, every tick it does. See [Entities on It](#entities-on-it). | |
|
||||
| `fluid_handler(block, params, face?)` | Something reaches for its tanks from `face`. See [Fluid Handlers](../resources/fluids.md#fluid-handlers). | a `FluidHandler`, or `undefined` |
|
||||
|
||||
`block` is `{ id, x, y, z, biome, season, data, get_client_data, set_client_data, set_ticking }`, where `data` is the
|
||||
block's [tile data](tiledata.md) and the client data functions its [part clients see](tiledata.md#client-data), `biome`
|
||||
|
||||
Reference in New Issue
Block a user