Struct LootStack
#[non_exhaustive]pub struct LootStack {
pub item: ItemKey,
pub count: i32,
pub damage: i32,
pub enchantments: Vec<(String, i32)>,
pub potion: Option<String>,
pub map: bool,
pub exploration: Option<Box<ExplorationMap>>,
pub ominous_amplifier: Option<i32>,
pub stew_effects: Vec<(String, i32)>,
pub names: Vec<(String, Text)>,
pub components: Vec<(String, Option<Tag>)>,
}Expand description
A loot function’s intermediate item candidate, before inventory materialization.
Counts can be non-positive while loot functions run; unlike ItemStack, this
is a roll’s intermediate data and does not represent an occupied inventory slot.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.item: ItemKeyResolved candidate item.
count: i32Intermediate count; a non-positive result produces no item.
damage: i32Intermediate damage value.
enchantments: Vec<(String, i32)>Enchantment identifiers and levels in loot-function order.
potion: Option<String>Potion identifier.
map: boolWhether to create the map ID component after the roll.
exploration: Option<Box<ExplorationMap>>A deferred exploration-map search.
ominous_amplifier: Option<i32>Ominous bottle amplifier.
stew_effects: Vec<(String, i32)>Suspicious stew effect identifiers and durations in ticks.
names: Vec<(String, Text)>Custom or item name components, still unresolved styled trees.
components: Vec<(String, Option<Tag>)>Ordered component patches; None removes a component.
Implementations§
Trait Implementations§
impl StructuralPartialEq for LootStack
Auto Trait Implementations§
impl Freeze for LootStack
impl RefUnwindSafe for LootStack
impl Send for LootStack
impl Sync for LootStack
impl Unpin for LootStack
impl UnsafeUnpin for LootStack
impl UnwindSafe for LootStack
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