Effect constructor

Effect(
  1. EffectType? effect, {
  2. Entity? entity,
  3. Time? duration = const Time.seconds(30),
  4. int? amplifier = 1,
  5. 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();
}