Single module modding
This commit is contained in:
@@ -93,19 +93,19 @@ summer in `desert`.
|
||||
|
||||
Scripts read the season where something is:
|
||||
|
||||
| Where | Biome | Season |
|
||||
| ----------------------------------------------- | ----------------------------- | ------------------------------ |
|
||||
| a block in a server component, like `on_tick` | `block.biome` | `block.season` |
|
||||
| an entity from `ctx.world.spawn_entity` | `entity.biome` | `entity.season` |
|
||||
| a player, on the server | `player.biome` | `player.season` |
|
||||
| any block, in server, shared and client scripts | `ctx.world.biome_at(x, y, z)` | `ctx.world.season_at(x, y, z)` |
|
||||
| the player on this client | `ctx.player.biome` | `ctx.player.season` |
|
||||
| a feature's chunk, see [Features](index.md) | `chunk.biome_at(x, y, z)` | |
|
||||
| Where | Biome | Season |
|
||||
| ---------------------------------------------- | ----------------------------- | ------------------------------ |
|
||||
| a block in a server component, like `on_tick` | `block.biome` | `block.season` |
|
||||
| an entity from `ctx.world.spawn_entity` | `entity.biome` | `entity.season` |
|
||||
| a player, on the server | `player.biome` | `player.season` |
|
||||
| any block, in server, shared and client phases | `ctx.world.biome_at(x, y, z)` | `ctx.world.season_at(x, y, z)` |
|
||||
| the player on this client | `ctx.player.biome` | `ctx.player.season` |
|
||||
| a feature's chunk, see [Features](index.md) | `chunk.biome_at(x, y, z)` | |
|
||||
|
||||
`biome_at` is NeoForge's `level.getBiome(pos)`. Entities and players go by the block their feet are in, like
|
||||
`level.getBiome(entity.blockPosition())`. Above and below the world it's the biome at its top or bottom. On the server
|
||||
every block has a biome: in a chunk that isn't loaded it's what generation makes there, which takes a while the first
|
||||
time. In shared rules and client scripts it's what that client has loaded, and `undefined` where it has nothing.
|
||||
time. In shared rules and client phases it's what that client has loaded, and `undefined` where it has nothing.
|
||||
|
||||
```ts
|
||||
ctx.components.register_block("my_mod:crop", {
|
||||
|
||||
Reference in New Issue
Block a user