Block visuals

This commit is contained in:
2026-10-13 23:52:30 -03:00
parent 55ad08266e
commit 6ad476ac18
19 changed files with 854 additions and 14 deletions
+2 -1
View File
@@ -76,7 +76,8 @@ ctx.components.register_block("copper_tools:shaft", {
changes often doesn't resend the others, and setting a field to what it already is sends nothing.
- `undefined` removes a field. All of them go when the block is broken or replaced.
- It's saved with the world. `get_client_data` and `set_client_data` copy the value, so change it by setting it again.
- Client scripts read it with `ctx.world.get_client_data<T>(x, y, z, field)`, see [GUI](../gui/index.md).
- Client scripts read it with `ctx.world.get_client_data<T>(x, y, z, field)`, see [GUI](../gui/index.md). A block's
[visual](visuals.md) reads it with `block.get_client_data`, and its `update` is called when a field changes.
Like NeoForge's `getUpdateTag`, but per field. Keep it to what clients need to draw the block: everything in it is sent
to every player near it.