Class IceSpickes


public class IceSpickes extends ConstructRangedSpell<IceSpikeConstruct>
  • Constructor Details

    • IceSpickes

      public IceSpickes()
  • Method Details

    • spawnConstruct

      protected boolean spawnConstruct(CastContext ctx, net.minecraft.world.phys.Vec3 origin, @Nullable @Nullable net.minecraft.core.Direction side)
      Description copied from class: ConstructSpell
      Spawns the construct entity in the world at the specified position.

      This method creates the construct entity using the factory, sets its position and caster, configures its lifetime, applies damage and size multipliers, and adds it to the world.

      If ConstructSpell.allowOverlap is false, this method checks for existing constructs of the same type at the target position and prevents spawning if one exists.

      This method also calls ConstructSpell.addConstructExtras(CastContext, MagicConstructEntity, Direction) to allow subclasses to apply additional modifications to the construct before spawning.

      Overrides:
      spawnConstruct in class ConstructSpell<IceSpikeConstruct>
      Parameters:
      ctx - the cast context containing spell information and modifiers
      origin - the position where the construct should be spawned
      side - the direction the construct is facing, or null if not applicable
      Returns:
      true if the construct was successfully spawned, false if spawning was prevented (e.g., due to overlap)
    • isCollisionShapeFullBlock

      public boolean isCollisionShapeFullBlock(net.minecraft.world.level.BlockGetter blockGetter, net.minecraft.core.BlockPos pos)
    • addConstructExtras

      protected void addConstructExtras(CastContext ctx, IceSpikeConstruct construct, net.minecraft.core.Direction side)
      Description copied from class: ConstructSpell
      Applies additional modifications to the construct after it has been created and configured, but before it is added to the world.

      Override this method in subclasses to apply spell-specific behavior, additional attributes, or visual effects to the construct.

      Overrides:
      addConstructExtras in class ConstructSpell<IceSpikeConstruct>
      Parameters:
      ctx - the cast context containing spell information and modifiers
      construct - construct entity that has been created and configured
      side - direction the construct is facing, or null if not applicable
    • 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.
      Overrides:
      properties in class ConstructSpell<IceSpikeConstruct>
      Returns:
      A SpellProperties object with the default properties for your spell.