pub enum ToolPredicate {
Item(Identifier),
HasEnchantment {
enchantment: Identifier,
min_level: i32,
},
Tag(Identifier),
Any,
}Expand description
Predicate for matching tools.
Variants§
Item(Identifier)
Match a specific item.
HasEnchantment
Match items with a specific enchantment at minimum level.
Tag(Identifier)
Match items in a tag.
Any
Always matches (no predicate specified).
Implementations§
Source§impl ToolPredicate
impl ToolPredicate
Sourcepub fn test<R: Rng>(&self, tool: &ItemStack, _ctx: &LootContext<'_, R>) -> bool
pub fn test<R: Rng>(&self, tool: &ItemStack, _ctx: &LootContext<'_, R>) -> bool
Test if the tool matches this predicate.
Trait Implementations§
Source§impl Clone for ToolPredicate
impl Clone for ToolPredicate
Source§fn clone(&self) -> ToolPredicate
fn clone(&self) -> ToolPredicate
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 ToolPredicate
impl RefUnwindSafe for ToolPredicate
impl Send for ToolPredicate
impl Sync for ToolPredicate
impl Unpin for ToolPredicate
impl UnsafeUnpin for ToolPredicate
impl UnwindSafe for ToolPredicate
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