PlacedObject
Something placed that is more than a block: furniture, stations, chests, beds, doors, crops, and server objects made from content packs' models.
A handle to something in the game. Once that thing is gone, its calls fail with Gone. You get one from world.objects_near(...), world.object_at(...), and events.
Methods
| Method | Description |
|---|---|
fn item(&self) -> Result<ItemType>ItemType item() | What it is. |
fn at(&self) -> Result<BlockPos>BlockPos at() | Its first block. |
fn facing(&self) -> Result<f64>double facing() | Which way it faces, in degrees. |
fn station(&self) -> Result<Option<Station>>Optional<Station> station() | What kind of station it is, if one. |
fn open(&self) -> Result<bool>boolean open() | Whether a door or lid stands open. |
fn crop_percent(&self) -> Result<Option<i64>>Optional<Long> cropPercent() | How grown a crop is, 0 to 100. |
fn model(&self) -> Result<Option<Model>>Optional<Model> model() | The content pack's model it is made from, if a server object (none while its pack is not in use). |
fn container(&self) -> Result<Option<Container>>Optional<Container> container() | Its contents, for a chest, barrel or shelf. |
fn set_open(&self, open: bool) -> Result<()>void setOpen(boolean open) world_edit | Opens or shuts a door or lid. |
fn remove(&self, drop: bool) -> Result<()>void remove(boolean drop) world_edit | Takes it down, dropping it as an item or not (a server object drops nothing). |
fn play(&self, clip: &str, looping: bool) -> Result<()>void play(String clip, boolean looping) world_edit | Has a server object play one of its model's animations, from its start (again if it is playing), once (holding its last frame) or looping; an empty name goes back to idle (or open while it stands open). |
Container
A chest's, barrel's or shelf's slots.
A handle to something in the game. Once that thing is gone, its calls fail with Gone.
| Method | Description |
|---|---|
fn slots(&self) -> Result<i64>long slots() | How many slots. |
fn get(&self, slot: i64) -> Result<Option<ItemStack>>Optional<ItemStack> get(long slot) | What a slot holds. |
fn set(&self, slot: i64, stack: Option<ItemStack>) -> Result<()>void set(long slot, ItemStack stack) world_edit | Sets a slot. |
fn add(&self, stack: ItemStack) -> Result<Option<ItemStack>>Optional<ItemStack> add(ItemStack stack) world_edit | Adds where it fits; returns what did not. |
Station
A crafting station.
One of a fixed set of values.
| Value | Meaning |
|---|---|
Station::WorkbenchStation.WORKBENCH | The workbench. |
Station::AnvilStation.ANVIL | The anvil. |
Station::FletchingBenchStation.FLETCHING_BENCH | The fletching bench. |
Station::ForgeStation.FORGE | The forge. |
Station::CauldronStation.CAULDRON | The brewing cauldron. |
Station::CampfireStation.CAMPFIRE | A campfire's rim. |
Station::CookingPotStation.COOKING_POT | A cooking pot over a campfire. |
Events
Related events: ObjectPlacing, ObjectRemoved, ContainerOpening, DoorUsed.