| Crates.io | bevy_mod_value_filter |
| lib.rs | bevy_mod_value_filter |
| version | 1.0.2 |
| created_at | 2025-08-11 09:15:47.466373+00 |
| updated_at | 2025-08-14 17:15:58.080728+00 |
| description | A third party crate for bevy that enable value-based filtering |
| homepage | |
| repository | https://github.com/craftyneil/bevy_mod_value_filter |
| max_upload_size | |
| id | 1789808 |
| size | 33,735 |
[!TIP] bevy_mod_value_filter is a rework of the crate bevy_mod_check_filter that makes it compatible with bevy 0.16.1 and higher.
A query filter to allow Enabled-style marker components without losing the
ergonomics of ZST-style marker component filtering!
Without bevy_mod_value_filter:
#[derive(Component)]
struct Poisoned;
#[derive(Component)]
struct Name { name: &'static str }
fn all_poisoned(entities: Query<&Name, With<Poisoned>>) {
// ...
}
With bevy_mod_value_filter:
#[derive(Component)]
struct Poisoned(pub bool);
impl std::ops::Deref for Poisoned {
type Target = bool;
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[derive(Component)]
struct Name { name: &'static str }
fn all_poisoned(entities: Query<&Name, Check<Poisoned, Is<true>>>) {
// ...
}
// OR with one of the provided type aliases:
fn find_poisoned(entities: Query<&Name, IsTrue<Poisoned>>) {
// ...
}
All code in this repository is dual-licensed under either: