pub struct AdvancementReward {
pub id: String,
pub item: String,
pub nbt: Option<String>,
pub book: Option<String>,
}Expand description
A loot table entry used as an advancement reward (grants items when an
advancement is completed). Replaces patchouli:guide_book loot.
Fields§
§id: String§item: StringThe item to grant (default: special book item when book rewards).
nbt: Option<String>Optional NBT tag to apply.
book: Option<String>If set, the reward links to a yog-book.
Implementations§
Source§impl AdvancementReward
impl AdvancementReward
pub fn new(id: impl Into<String>) -> AdvancementReward
pub fn item(self, item: impl Into<String>) -> AdvancementReward
pub fn nbt(self, nbt: impl Into<String>) -> AdvancementReward
pub fn book(self, book: impl Into<String>) -> AdvancementReward
pub fn to_json(&self) -> String
Trait Implementations§
Source§impl Clone for AdvancementReward
impl Clone for AdvancementReward
Source§fn clone(&self) -> AdvancementReward
fn clone(&self) -> AdvancementReward
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for AdvancementReward
impl RefUnwindSafe for AdvancementReward
impl Send for AdvancementReward
impl Sync for AdvancementReward
impl Unpin for AdvancementReward
impl UnsafeUnpin for AdvancementReward
impl UnwindSafe for AdvancementReward
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