Class ForestsCurse


public class ForestsCurse extends AreaEffectSpell
  • Constructor Details

    • ForestsCurse

      public ForestsCurse()
  • 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
    • spawnParticle

      protected void spawnParticle(net.minecraft.world.level.Level world, double x, double y, double z)
      Description copied from class: AreaEffectSpell
      Spawns a single particle at the specified position.

      Override this method in subclasses to define which particle type to spawn and with what parameters. This method is called multiple times by AreaEffectSpell.spawnParticleEffect(CastContext, Vec3, double) to create the full particle effect.

      Overrides:
      spawnParticle in class AreaEffectSpell
      Parameters:
      world - the world to spawn the particle in
      x - the x coordinate
      y - the y coordinate
      z - the z coordinate
    • 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.