Class Firestorm


public class Firestorm extends AreaEffectSpell
  • Constructor Details

    • Firestorm

      public Firestorm()
  • Method Details

    • cast

      public boolean cast(PlayerCastContext ctx)
      Description copied from class: Spell
      This cast method is meant to be used for spells that are cast by a player source. This is useful for spells that are meant to be cast by players, as it provides more information about the caster and the context of the cast.

      Override this method to implement the casting behavior for spells that are meant to be cast by players.

      Overrides:
      cast in class AreaEffectSpell
      Parameters:
      ctx - The context of the spell cast, containing information about the world, caster, hand used, modifiers, etc.
      Returns:
      true if the spell was successfully cast, false otherwise. If this returns false, the spell will not be considered as having been cast, so no cooldown will be applied.
    • cast

      public boolean cast(EntityCastContext ctx)
      Description copied from class: Spell
      This cast method is meant to be used for spells that are cast by an entity source, like a mob. This is useful for spells that are meant to be cast by entities, as it provides more information about the caster and the context of the cast.

      Override this method to implement the casting behavior for spells that are meant to be cast by entities.

      Overrides:
      cast in class AreaEffectSpell
      Parameters:
      ctx - The context of the spell cast, containing information about the world, caster, modifiers, etc.
      Returns:
      true if the spell was successfully cast, false otherwise. If this returns false, the spell will not be considered as having been cast, so no cooldown will be applied.
    • cast

      public boolean cast(LocationCastContext ctx)
      Description copied from class: Spell
      This cast method is meant to be used for spells that are not cast by an entity, but rather by a non-entity source, like a command block or a dispenser. This is useful for spells that are meant to be cast in a specific location without needing an entity to cast them. By default, this returns false, as most spells are meant to be cast by entities. You can override this to return true if your spell is meant to be cast by non-entity sources and to implement the casting behavior for that case.
      Overrides:
      cast in class AreaEffectSpell
      Parameters:
      ctx - The context of the spell cast, containing information about the world, location, modifiers, etc.
      Returns:
      true if the spell was successfully cast, false otherwise. If this returns false, the spell will not be considered as having been cast, so no cooldown will be applied.
    • getAction

      public SpellAction getAction()
      Description copied from class: Spell
      Gets the action of this spell. By default, this is SpellAction.POINT.
      Overrides:
      getAction in class Spell
      Returns:
      The action of this spell.
    • getChargeUp

      public int getChargeUp()
      Description copied from class: Spell
      Gets the charge-up time of this spell in ticks. By default, this is 0, meaning the spell is instant and has no charge-up time.
      Overrides:
      getChargeUp in class Spell
      Returns:
      The charge-up time of this spell in ticks.
    • 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.