pub trait BlockAttachedEntity: Entity {
Show 16 methods
// Required methods
fn block_attached_entity_base(&self) -> &BlockAttachedEntityBase;
fn survives(&self) -> bool;
fn drop_item(&self, caused_by: Option<&dyn Entity>);
fn recalculate_bounding_box(&self) -> Result<(), EntityMoveError>;
// Provided methods
fn tick_block_attached_entity(self: Arc<Self>) { ... }
fn is_pickable_block_attached_entity(&self) -> bool { ... }
fn skip_attack_interaction_block_attached_entity(
&self,
source: &SharedEntity,
) -> bool { ... }
fn kill_attributed(&self, attributed_to: Option<&dyn Entity>) { ... }
fn hurt_block_attached_entity(
&self,
world: &World,
source: &DamageSource,
_amount: f32,
) -> bool { ... }
fn drop_if_dvec3_is_nonzero(&self, impulse: DVec3) { ... }
fn move_entity_block_attached_entity(
self: Arc<Self>,
_mover_type: MoverType,
delta: DVec3,
) -> Option<MoveResult> { ... }
fn push_impulse_block_attached_entity(&self, impulse: DVec3) { ... }
fn save_block_attached_entity(&self, nbt: &mut NbtCompound) { ... }
fn load_block_attached_entity(&self, nbt: BorrowedNbtCompoundView<'_, '_>) { ... }
fn refresh_dimensions_block_attached_entity(&self) { ... }
fn try_set_position_block_attached_entity(
&self,
pos: DVec3,
) -> Result<(), EntityMoveError> { ... }
}Required Methods§
Sourcefn block_attached_entity_base(&self) -> &BlockAttachedEntityBase
fn block_attached_entity_base(&self) -> &BlockAttachedEntityBase
Returns the shared block-attached entity runtime state.
fn survives(&self) -> bool
fn drop_item(&self, caused_by: Option<&dyn Entity>)
fn recalculate_bounding_box(&self) -> Result<(), EntityMoveError>
Provided Methods§
fn tick_block_attached_entity(self: Arc<Self>)
fn is_pickable_block_attached_entity(&self) -> bool
fn skip_attack_interaction_block_attached_entity( &self, source: &SharedEntity, ) -> bool
Sourcefn kill_attributed(&self, attributed_to: Option<&dyn Entity>)
fn kill_attributed(&self, attributed_to: Option<&dyn Entity>)
Removes this entity as killed, attributing the death game event to attributed_to
(or to this entity when None).
fn hurt_block_attached_entity( &self, world: &World, source: &DamageSource, _amount: f32, ) -> bool
fn drop_if_dvec3_is_nonzero(&self, impulse: DVec3)
fn move_entity_block_attached_entity( self: Arc<Self>, _mover_type: MoverType, delta: DVec3, ) -> Option<MoveResult>
fn push_impulse_block_attached_entity(&self, impulse: DVec3)
fn save_block_attached_entity(&self, nbt: &mut NbtCompound)
fn load_block_attached_entity(&self, nbt: BorrowedNbtCompoundView<'_, '_>)
fn refresh_dimensions_block_attached_entity(&self)
fn try_set_position_block_attached_entity( &self, pos: DVec3, ) -> Result<(), EntityMoveError>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".