Class PlagueOfDarkness


public class PlagueOfDarkness extends AreaEffectSpell
  • Constructor Details

    • PlagueOfDarkness

      public PlagueOfDarkness()
  • Method Details

    • affectEntity

      protected boolean affectEntity(CastContext ctx, net.minecraft.world.phys.Vec3 origin, net.minecraft.world.entity.LivingEntity target, int targetCount)
      Description copied from class: AreaEffectSpell
      Applies the spell's effect to a single target entity.

      This method must be implemented by subclasses to define what happens when the spell affects an entity. It is called for each valid target found within the area of effect, in order of distance from the origin (closest first).

      Specified by:
      affectEntity in class AreaEffectSpell
      Parameters:
      ctx - the cast context containing spell information and modifiers
      origin - the center point of the area effect
      target - the entity to affect
      targetCount - the index of this target in the sorted list (0 for the closest entity, 1 for the second closest, etc.)
      Returns:
      true if the entity was successfully affected, false otherwise
    • spawnParticleEffect

      protected void spawnParticleEffect(CastContext ctx, net.minecraft.world.phys.Vec3 origin, double radius)
      Description copied from class: AreaEffectSpell
      Spawns particle effects in a circular pattern around the origin point.

      The number of particles is determined by particleDensity * π * radius². Particles are spawned at random positions within the radius, distributed in a circle around the origin.

      This method calls AreaEffectSpell.spawnParticle(Level, double, double, double) for each particle position. Override spawnParticle to define which particles to spawn.

      Overrides:
      spawnParticleEffect in class AreaEffectSpell
      Parameters:
      ctx - the cast context containing spell information
      origin - the center point of the area effect
      radius - the radius of the area effect
    • properties

      @NotNull protected @NotNull SpellProperties properties()
      Description copied from class: Spell
      This method is where you should set the default properties for your spell when creating a new spell class. This method is called in the constructor of the Spell class, and the properties returned by this method are assigned to the spell's properties field.
      Specified by:
      properties in class Spell
      Returns:
      A SpellProperties object with the default properties for your spell.