Fishing hook
This commit is contained in:
@@ -532,16 +532,35 @@ Mobs are an entity in `entities/` and a bedrock entity model in `models/`. `enti
|
||||
}
|
||||
```
|
||||
|
||||
| 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. |
|
||||
| Field | Default | What it does |
|
||||
| ---------------- | ---------- | ------------------------------------------------------------------------------------- |
|
||||
| `model` | | An entity model, see below. Without one it's drawn as its texture, facing the camera. |
|
||||
| `texture` | | Any texture, stretched to the model's `texture_width` and `texture_height`. |
|
||||
| `behavior` | `"animal"` | `"animal"` or `"scripted"`, see below. |
|
||||
| `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.
|
||||
An animal wanders around, panics when hurt, looks at players now and then, swims up in water and never despawns. A
|
||||
scripted entity stays where a script puts it (see `spawn_entity` in [Server scripts](#server-scripts)): it doesn't fall,
|
||||
think or get hurt, and isn't saved with the world, so a script never finds one it doesn't know about after a restart.
|
||||
The fishing hook is one, drawn as its texture since it has no model:
|
||||
|
||||
```json
|
||||
{
|
||||
"format_version": 1,
|
||||
"entity": {
|
||||
"id": "bworld:fishing_hook",
|
||||
"texture": "bworld:fishing_hook",
|
||||
"behavior": "scripted",
|
||||
"width": 0.25,
|
||||
"height": 0.25
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Without a model, the whole texture is drawn 16 pixels to a block, centered on the middle of its box.
|
||||
`/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`
|
||||
@@ -791,6 +810,7 @@ interface ServerWorld {
|
||||
set_state(x: number, y: number, z: number, name: string, value: number): boolean;
|
||||
get_block_data<T>(x: number, y: number, z: number): T | undefined;
|
||||
drop_item(x: number, y: number, z: number, item: ItemStack): void; // pops out of the block, like drops
|
||||
spawn_entity(id: string, x: number, y: number, z: number): EntityRef; // feet at x y z, see Entities
|
||||
is_loaded(x: number, z: number): boolean;
|
||||
readonly seed: string;
|
||||
readonly time: number; // world time, see below
|
||||
@@ -798,6 +818,16 @@ interface ServerWorld {
|
||||
set_time(time: number): void; // synced to every player
|
||||
}
|
||||
|
||||
// once it's removed, by a script or anything else, it stays removed and teleporting it does nothing
|
||||
interface EntityRef {
|
||||
readonly id: string;
|
||||
readonly type: string;
|
||||
readonly position: { x: number; y: number; z: number };
|
||||
readonly removed: boolean;
|
||||
teleport(x: number, y: number, z: number): void;
|
||||
remove(): void;
|
||||
}
|
||||
|
||||
interface Player {
|
||||
readonly id: string;
|
||||
readonly name: string;
|
||||
|
||||
Reference in New Issue
Block a user