pub struct Interaction {
pub label: String,
pub hits: u32,
pub effects: Vec<InteractionEffect>,
}Expand description
A declarative, codeless interaction a creator attaches to a placed object.
The whole point is that it’s trivial to author: no WASM, no scripting — you name the verb the visitor sees (“Chop”, “Mine”, “Pick”, “Talk”) and list what happens when it completes. The interact key (E) runs it.
"interaction": {
"label": "Chop",
"hits": 3,
"effects": [
{ "give_item": { "item": "20100001", "count": 3 } },
"despawn",
{ "message": "You chopped the old oak." }
]
}Fields§
§label: StringCreator-defined verb shown in the “[E] …” prompt (e.g. “Chop”, “Mine”).
hits: u32How many interactions to complete it — a tree takes a few chops. Default 1.
effects: Vec<InteractionEffect>What happens when it completes, applied top to bottom.
Trait Implementations§
Source§impl Clone for Interaction
impl Clone for Interaction
Source§impl Debug for Interaction
impl Debug for Interaction
Source§impl<'de> Deserialize<'de> for Interaction
impl<'de> Deserialize<'de> for Interaction
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Interaction
impl RefUnwindSafe for Interaction
impl Send for Interaction
impl Sync for Interaction
impl Unpin for Interaction
impl UnsafeUnpin for Interaction
impl UnwindSafe for Interaction
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more