Some more kinetic blocks
This commit is contained in:
@@ -34,6 +34,15 @@ everyone who can see the block. Unlike `set_block`, it doesn't run `on_break` or
|
||||
tile data. It runs the block's [`on_state_change`](components.md#changes) instead, and tells the blocks beside it,
|
||||
unless it's given `{ update_neighbors: false }`.
|
||||
|
||||
`set_block` puts a block there with its states at their defaults, or with the ones it's given, like Minecraft's
|
||||
`setBlock` with a block state. Turning one block into another that keeps its direction looks like this, and `on_create`
|
||||
already sees the new block turned the right way:
|
||||
|
||||
```ts
|
||||
const axis = ctx.world.get_state(x, y, z, "axis")!;
|
||||
ctx.world.set_block(x, y, z, "create:andesite_encased_shaft", { axis });
|
||||
```
|
||||
|
||||
## Variants
|
||||
|
||||
`variants` gives a block a different `model`, `textures` or rotation depending on its states. `blocks/wheat.json` shows
|
||||
|
||||
Reference in New Issue
Block a user