Model
A content pack's model: what server objects (furniture, props, statues) are made from.
Every Blockbench file in an approved pack's models/ folder is a model, named pack:file (the pack's id, then the file's name without .bbmodel). Place one in the world with World's place_model. The pack's objects/*.toml says whether it has a seat or storage, can be broken and gives light (see Objects). A model is sent to a player's headset the first time it comes near them.
A handle to something in the game. Once that thing is gone, its calls fail with Gone. You get one from Model.named(...), placed_object.model.
Methods
| Method | Description |
|---|---|
fn name(&self) -> Result<String>String name() | Its name, pack:file. |
fn extents(&self) -> Result<ModelSize>ModelSize extents() | Its size, in blocks. |
fn clips(&self) -> Result<Vec<String>>List<String> clips() | Its animations' names (idle, walk, open, ...), as PlacedObject.play takes them. |
fn named(name: &str) -> Result<Option<Model>>static Optional<Model> named(String name) | A model by its name (pack:file), if a pack in use has it and it can be placed (at most 16 blocks a side). |
ModelSize
A model's size, in blocks.
Plain data, copied between the server and the plugin.
| Field | Description |
|---|---|
x: f64double x() | Across (east-west, unturned). |
y: f64double y() | Up. |
z: f64double z() | Deep (north-south, unturned). |