Effect constructor
Effect(
- EffectType? effect, {
- Entity? entity,
- Time? duration = const Time.seconds(30),
- int? amplifier = 1,
- bool? showParticles = true,
This command is used to give an entity a specific effect and affect their gameplay.
Effect(
EffectType.jump_boost,
entity: Entity.Player(),
duration: 20.seconds,
amplifier: 3,
showParticles: false
)
⇒ effect give @p minecraft:jump_boost 20 3 true
From version 19.4 you can use Time.infinite() as duration to make the effect last forever
Implementation
Effect(
this.effect, {
this.entity,
this.duration = const Time.seconds(30),
this.amplifier = 1,
this.showParticles = true,
}) : _type = 'give' {
entity ??= Entity.Selected();
}