Skip to main content

steel_core/entity/
entity_selector.rs

1//! Shared entity predicates.
2
3use super::Entity;
4
5/// excludes creative and spectator players and accepts all other entities
6#[must_use]
7pub fn no_creative_or_spectator(entity: &dyn Entity) -> bool {
8    !entity
9        .as_player()
10        .is_some_and(|player| entity.is_spectator() || player.has_infinite_materials())
11}