Skip to content

Triggering an Event from an exclusive system fails silently #22096

@lucidBrot

Description

@lucidBrot

It seems an established fact† that observers can not be exclusive systems. This issue is about the opposite.

† : #14925 and #14507

Running commands.trigger(MyEvent) silently does nothing when done from an exclusive system.

Bevy version and features

bevy 0.17.3

Relevant system information

cargo 1.92.0-nightly (f2932725b 2025-09-24)

OS: debian

$ uname -a
Linux nevermore 6.12.48+deb13-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.12.48-1 (2025-09-20) x86_64 GNU/Linux

What you did

In my project, I had some older code that I was migrating from bevy 0.16, with one part of the code relying on moonshine-save also in need of a larger rework even since before. In that code, I had an exclusive system. The newest version of moonshine-save now uses bevy observers, but adding a commands.trigger call did not do anything. I have now reproduced this with no dependencies other than bevy: Triggering an Event does nothing.

What went wrong

I was expecting commands.trigger(MyEvent) to lead to the execution of the observer that I registered with app.add_observer(my_observer). Nothing happened, the observer was not called. Until I changed my system to no longer take World as parameter.

Additional information

I have attached a small example project that demonstrates the issue.

exclusive-observers.zip

There are two systems, which cause the sun to rise and set. The observer prints when it observes something. It works fine for the sunrise, but does not observe the sun set.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-ECSEntities, components, systems, and eventsC-BugAn unexpected or incorrect behaviorS-Needs-DesignThis issue requires design work to think about how it would best be accomplished

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions