pub struct BlockPredicate {
pub blocks: Option<IDSet>,
pub properties: Option<Vec<Property>>,
pub nbt: Option<Compound>,
pub exact_components: Vec<ExactComponentMatcher>,
pub partial_components: Vec<PartialComponentMatcher>,
}Expand description
Defines a rule for matching a block in the world.
Used by CanPlaceOn and CanBreak in Adventure Mode.
Fields§
§blocks: Option<IDSet>If None, matches any block ID.
properties: Option<Vec<Property>>Matches specific block state properties (e.g., lit=true).
nbt: Option<Compound>Matches the Block Entity’s NBT data.
exact_components: Vec<ExactComponentMatcher>(1.21+) Matches if the block drops an item containing these EXACT components. This is a strict equality check.
partial_components: Vec<PartialComponentMatcher>(1.21+) Matches if the block drops an item containing specific NBT structures within specific components.
Trait Implementations§
Source§impl Clone for BlockPredicate
impl Clone for BlockPredicate
Source§fn clone(&self) -> BlockPredicate
fn clone(&self) -> BlockPredicate
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for BlockPredicate
impl Debug for BlockPredicate
Source§impl Encode for BlockPredicate
impl Encode for BlockPredicate
Source§impl PartialEq for BlockPredicate
impl PartialEq for BlockPredicate
impl StructuralPartialEq for BlockPredicate
Auto Trait Implementations§
impl Freeze for BlockPredicate
impl RefUnwindSafe for BlockPredicate
impl Send for BlockPredicate
impl Sync for BlockPredicate
impl Unpin for BlockPredicate
impl UnwindSafe for BlockPredicate
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