bevyengine/bevy · error

B0001

B0001

Error message

error[B0001]: {type_name}{system} accesses component(s) {accesses}in a way that conflicts with a previous system parameter. Consider using `Without<T>` to create disjoint Queries or merging conflicting Queries into a `ParamSet`. See: https://bevy.org/learn/errors/b0001

What it means

Panic from QueryState::init_access during system initialization: this query's component access conflicts with a previously registered system parameter in the same system (B0001). Two params request incompatible access (e.g. &mut T vs &T) without a disjointness filter; the formatted list names the conflicting components and the error links the B0001 docs.

Source

Thrown at crates/bevy_ecs/src/query/state.rs:216

    pub fn init_access(
        &self,
        system_name: Option<&str>,
        component_access_set: &mut FilteredAccessSet,
        world: UnsafeWorldCell,
    ) {
        let conflicts = component_access_set.get_conflicts_single(&self.component_access);
        if !conflicts.is_empty() {
            let mut accesses = conflicts.format_conflict_list(world);
            // Access list may be empty (if access to all components requested)
            if !accesses.is_empty() {
                accesses.push(' ');
            }
            let type_name = DebugName::type_name::<Query<D, F>>();
            let type_name = type_name.shortname();
            let system = system_name
                .map(|name| format!(" in system {name}"))
                .unwrap_or_default();
            panic!("error[B0001]: {type_name}{system} accesses component(s) {accesses}in a way that conflicts with a previous system parameter. Consider using `Without<T>` to create disjoint Queries or merging conflicting Queries into a `ParamSet`. See: https://bevy.org/learn/errors/b0001",);
        }

        component_access_set.add(self.component_access.clone());
        D::init_nested_access(&self.fetch_state, system_name, component_access_set, world);
        F::init_nested_access(&self.filter_state, system_name, component_access_set, world);
    }

    /// Creates a new [`QueryState`] from a given [`World`] and inherits the result of `world.id()`.
    pub fn new(world: &mut World) -> Self {
        // SAFETY: We immediately call `init_access`
        let state = unsafe { Self::new_unchecked(world) };
        state.init_access(None, &mut FilteredAccessSet::new(), world.into());
        state
    }

    /// Creates a new [`QueryState`] from an immutable [`World`] reference and inherits the result of `world.id()`.
    ///
    /// This function may fail if, for example,

View on GitHub (pinned to 396ca72708)

Solutions

  1. Add Without<T> to one query so the accesses are provably disjoint
  2. Merge the conflicting queries into one or use a ParamSet
  3. Change one access to read-only (&T instead of &mut T)
  4. Split into two systems ordered with .before/.after
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/bevy_ecs/src/query/state.rs:216 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of bevyengine/bevy@396ca72708 (2026-08-20). Data as JSON: /api/errors/d5139f5bfe2f0105. Report an issue: GitHub.