···99### Applying Effects
1010Effects can be applied using `with_effect` or `with_effects` (similar to `with_child` and `with_children` respectively).
1111```rust ignore
1212-commands.entity(target).with_effect(EffectBundle {
1313- name: Name::new("Effect"),
1414- bundle: MyEffect,
1515- ..default()
1616-});
1212+commands.entity(target).with_effect((Name::new("Effect"), MyEffect));
1713```
1814They can also be added using spawn-style syntax.
1915```rust ignore
2016commands.spawn((
2117 Name::new("Target"),
2222- EffectedBy::spawn(EffectBundle {
2323- name: Name::new("Effect"),
2424- bundle: MyEffect,
2525- ..default()
2626- }),
1818+ EffectedBy::spawn(
1919+ Effect((Name::new("Effect"), MyEffect))
2020+ ),
2721));
2822```
2323+2424+Note that these methods *might* spawn a new entity, depending on what effects are already applied to the target.
29253026### Effect Modes
3127For some effects it makes sense to allow stacking, so a single entity could be effected by an effect multiple times.
+1-1
src/command.rs
···177177 #[doc = include_str!("../docs/with_effect_example.md")]
178178 fn with_effect<B: Bundle + Clone>(&mut self, bundle: B) -> &mut Self;
179179180180- /// Applies effects to this entity by taking a function that operates on a [`EffectSpawner`].
180180+ /// Applies effects to this entity by taking a function that operates on an [`EffectSpawner`].
181181 ///
182182 /// For applying a single effect, see [`with_effect`](Self::with_effect).
183183 ///
+4-10
src/spawnable_list.rs
···33use bevy_ecs::ptr::MovingPtr;
44use bevy_ecs::spawn::SpawnableList;
5566-/// A "bundle" of components/settings used when applying an effect.
77-/// Due to technical limitations, this doesn't actually implement [`Bundle`].
88-/// Instead, purpose build commands ([`with_effect`](crate::command::EffectCommandsExt::with_effect))
99-/// or related spawners ([`EffectedBy::spawn`](SpawnRelated::spawn)) should be used.
66+/// A wrapper over a [`Bundle`] indicating that an effect should be applied with that [`Bundle`].
77+/// This is intended to be used in [`EffectedBy::spawn`](SpawnRelated::spawn).
108///
1111-/// # Examples
1212-/// ### [`with_effect`](crate::command::EffectCommandsExt::with_effect)
1313-#[doc = include_str!("../docs/with_effect_example.md")]
1414-/// ### [`with_effects`](crate::command::EffectCommandsExt::with_effects) + [`EffectSpawner`](crate::command::EffectSpawner)
1515-#[doc = include_str!("../docs/with_effects_example.md")]
1616-/// ### [`EffectedBy::spawn`](SpawnRelated::spawn)
99+/// This *might* spawn a new entity, depending on what effects are already applied to the target.
1010+/// # Example
1711#[doc = include_str!("../docs/effected_by_spawn_example.md")]
1812#[derive(Default)]
1913pub struct Effect<B: Bundle>(pub B);