Messy but working chicken
This commit is contained in:
@@ -27,7 +27,7 @@ bworld's modding takes from three places:
|
||||
- [manifest.json](#manifestjson)
|
||||
- [Identifiers](#identifiers)
|
||||
- Data: [Textures](#textures), [Blocks](#blocks), [Block models](#block-models), [Crops](#crops), [Items](#items),
|
||||
[Recipes](#recipes), [Overrides](#overrides)
|
||||
[Recipes](#recipes), [Entities](#entities), [Overrides](#overrides)
|
||||
- Game API: [Common scripts](#common-scripts), [Server scripts](#server-scripts), [Client scripts](#client-scripts),
|
||||
[GUIs](#guis), [Mod channels](#mod-channels), [World generation](#world-generation)
|
||||
- [Engine access](#engine-access)
|
||||
@@ -123,7 +123,9 @@ mods/
|
||||
deno.json # optional: the mod is its own deno project, see Mod files
|
||||
blocks/*.json
|
||||
models/*.json
|
||||
models/*.geo.json # entity models
|
||||
items/*.json
|
||||
entities/*.json
|
||||
recipes/*.json
|
||||
overrides/*.json # changes to other mods' content
|
||||
worldgen/ores.json
|
||||
@@ -511,6 +513,42 @@ optional `container` (like `"bworld:bowl"`) is what the meal is served in, and `
|
||||
set. It cooks while the block under it is hot: a lit stove (placed lit, relit with coal, put out with a shovel), or a
|
||||
burning furnace, whose `lit` state is 1 while it has fuel.
|
||||
|
||||
## Entities
|
||||
|
||||
Mobs are an entity in `entities/` and a bedrock entity model in `models/`. `entities/chicken.json`:
|
||||
|
||||
```json
|
||||
{
|
||||
"format_version": 1,
|
||||
"entity": {
|
||||
"id": "bworld:chicken",
|
||||
"model": "bworld:chicken",
|
||||
"texture": "bworld:chicken",
|
||||
"width": 0.3,
|
||||
"height": 0.4,
|
||||
"max_health": 4,
|
||||
"movement_speed": 0.25
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
| Field | Default | What it does |
|
||||
| ---------------- | ------- | --------------------------------------------------------------------------- |
|
||||
| `model` | | An entity model, see below. |
|
||||
| `texture` | | Any texture, stretched to the model's `texture_width` and `texture_height`. |
|
||||
| `width`/`height` | | Its collision box in blocks. Its eyes are at 85% of the height. |
|
||||
| `max_health` | `10` | Half hearts. |
|
||||
| `movement_speed` | `0.25` | Minecraft's per tick speed, 0.25 for most animals. |
|
||||
|
||||
Every entity is an animal for now: it wanders around, panics when hurt, looks at players now and then, swims up in
|
||||
water and never despawns. `/summon <entity>` spawns one where you stand.
|
||||
|
||||
Entity models are `models/<name>.geo.json`, as Blockbench exports them for Bedrock (the "Bedrock Entity" format), with
|
||||
id `<mod_id>:<name>`. Only the first geometry is used, and from it the bones' `name`, `parent`, `pivot` and `rotation`
|
||||
and the cubes' `origin`, `size`, `uv` and `inflate`. Cubes need box uv, per face uv isn't supported. The model faces
|
||||
-z, 16 pixels to a block, and shows the way Blockbench shows it. It doesn't animate yet: the whole model turns with the
|
||||
entity, and a bone named `head` turns to where it looks.
|
||||
|
||||
## Overrides
|
||||
|
||||
A mod can change content other mods registered, like Minetest's `override_item`. The JSON form covers the common cases,
|
||||
@@ -1834,5 +1872,6 @@ any order after them.
|
||||
warnings and a changelog to keep.
|
||||
- **Screen scaling.** The GUI currently works in raw canvas pixels (`SLOT_SIZE` is 54). `Graphics` should probably use a
|
||||
UI scale the player can change, with screens laid out in scaled units.
|
||||
- **Entities.** The only entities are players and dropped items, so mob mods need entity types in the Game API first.
|
||||
- **Entities.** Mods can define simple animals in `entities/`, but there's no Game API for entity types with their
|
||||
own behavior, animations, or spawning them naturally yet.
|
||||
- **Hot reload.** Restarting the server and reconnecting is the version 1 answer.
|
||||
|
||||
Reference in New Issue
Block a user