Interface ProjectileStateAccessor

All Superinterfaces:
EntityStateAccessor
All Known Implementing Classes:
StateDeclarationMixin

public interface ProjectileStateAccessor extends EntityStateAccessor
Duck interface injected into Projectile via StateDeclarationMixin defining mutable physics and behavioral parameters for in-flight projectiles.

Populated once at the start of a projectile's flight by StateCaptureMixin and queried by aerodynamic drag, homing, magnetism, ricochet, and shrapnel mixins.

  • Method Details

    • enchantment_core$setDragMultiplier

      void enchantment_core$setDragMultiplier(double multiplier)
      Sets the multiplier applied to the projectile's base aerodynamic/fluid velocity retention factor.
      Parameters:
      multiplier - The drag multiplier.
    • enchantment_core$setHomingStrength

      void enchantment_core$setHomingStrength(double strength)
      Sets the steering interpolation strength applied when tracking a homing target.
      Parameters:
      strength - The homing tracking strength.
    • enchantment_core$setHomingPrioritizesHead

      void enchantment_core$setHomingPrioritizesHead(boolean prioritizesHead)
      Sets whether homing steering aims for the target's eye height instead of its bounding box center.
      Parameters:
      prioritizesHead - true to prioritize the head/eyes, false for center of mass.
    • enchantment_core$setHomingArmingDistance

      void enchantment_core$setHomingArmingDistance(double distance)
      Sets the minimum distance (in blocks) the projectile must travel from its spawn point before homing activates.
      Parameters:
      distance - The arming distance in blocks.
    • enchantment_core$setHomingMinDistance

      void enchantment_core$setHomingMinDistance(double distance)
      Sets the near-clipping plane distance (in blocks) of the homing target acquisition frustum.
      Parameters:
      distance - The minimum tracking distance in blocks.
    • enchantment_core$setHomingMaxDistance

      void enchantment_core$setHomingMaxDistance(double distance)
      Sets the far-clipping plane distance (in blocks) of the homing target acquisition frustum.
      Parameters:
      distance - The maximum tracking distance in blocks.
    • enchantment_core$setHomingFov

      void enchantment_core$setHomingFov(double fov)
      Sets the field-of-view cone angle (in degrees) restricting homing target acquisition.
      Parameters:
      fov - The field-of-view angle in degrees.
    • enchantment_core$setHomingTurnRate

      void enchantment_core$setHomingTurnRate(double turnRate)
      Sets the maximum angular rotation (in degrees per tick) the projectile can turn during homing.
      Parameters:
      turnRate - The turn rate limit in degrees per tick.
    • enchantment_core$setBouncesRemaining

      void enchantment_core$setBouncesRemaining(int bounces)
      Sets the number of block-surface ricochet bounces remaining for the projectile.
      Parameters:
      bounces - The number of bounces remaining.
    • enchantment_core$setRicochetRetention

      void enchantment_core$setRicochetRetention(double retention)
      Sets the fraction of velocity magnitude retained after a ricochet bounce.
      Parameters:
      retention - The velocity retention multiplier.
    • enchantment_core$setMagneticStrength

      void enchantment_core$setMagneticStrength(double strength)
      Sets the attractive pull strength steering the projectile toward nearby magnetic targets.
      Parameters:
      strength - The magnetic pull strength.
    • enchantment_core$setMagneticPrioritizesHead

      void enchantment_core$setMagneticPrioritizesHead(boolean head)
      Sets whether magnetic trajectory attraction aims for the target's eye height.
      Parameters:
      head - true to target the head/eyes, false for center of mass.
    • enchantment_core$setMagneticArmingDistance

      void enchantment_core$setMagneticArmingDistance(double distance)
      Sets the minimum distance (in blocks) the projectile must travel before magnetic attraction activates.
      Parameters:
      distance - The arming distance in blocks.
    • enchantment_core$setMagneticSearchRadius

      void enchantment_core$setMagneticSearchRadius(double radius)
      Sets the radial search distance (in blocks) within which candidate targets are evaluated for magnetism.
      Parameters:
      radius - The search radius in blocks.
    • enchantment_core$setShrapnelGenerations

      void enchantment_core$setShrapnelGenerations(int generations)
      Sets the number of recursive shrapnel split generations remaining upon impact.
      Parameters:
      generations - The number of shrapnel generations.
    • enchantment_core$setShrapnelAmount

      void enchantment_core$setShrapnelAmount(int amount)
      Sets the number of child shrapnel projectiles spawned per fracture event.
      Parameters:
      amount - The child projectile count per split.
    • enchantment_core$setShrapnelSpread

      void enchantment_core$setShrapnelSpread(double spread)
      Sets the inaccuracy cone spread angle (in degrees) applied to spawned shrapnel projectiles.
      Parameters:
      spread - The spread angle in degrees.
    • enchantment_core$setShrapnelVelocityRetention

      void enchantment_core$setShrapnelVelocityRetention(double retention)
      Sets the fraction of the parent projectile's speed inherited by spawned shrapnel projectiles.
      Parameters:
      retention - The velocity retention multiplier.
    • enchantment_core$setShrapnelDamageRetention

      void enchantment_core$setShrapnelDamageRetention(double retention)
      Sets the fraction of the parent arrow's base damage inherited by spawned shrapnel arrows.
      Parameters:
      retention - The damage retention multiplier.
    • enchantment_core$setShrapnelTriggerBlock

      void enchantment_core$setShrapnelTriggerBlock(boolean trigger)
      Sets whether impacting a block triggers shrapnel fracturing.
      Parameters:
      trigger - true to trigger on block impact, false otherwise.
    • enchantment_core$setShrapnelTriggerEntity

      void enchantment_core$setShrapnelTriggerEntity(boolean trigger)
      Sets whether impacting an entity triggers shrapnel fracturing.
      Parameters:
      trigger - true to trigger on entity impact, false otherwise.
    • enchantment_core$setCalculated

      void enchantment_core$setCalculated(boolean calculated)
      Sets the state lock flag indicating whether weapon enchantment modifiers have been evaluated and cached on this projectile.
      Parameters:
      calculated - true once initial evaluation is complete, false otherwise.
    • enchantment_core$getDragMultiplier

      double enchantment_core$getDragMultiplier()
      Retrieves the active aerodynamic drag multiplier.
      Returns:
      The drag multiplier (defaults to 1.0).
    • enchantment_core$getHomingStrength

      double enchantment_core$getHomingStrength()
      Retrieves the homing tracking strength.
      Returns:
      The homing strength (defaults to 0.0).
    • enchantment_core$getHomingPrioritizesHead

      boolean enchantment_core$getHomingPrioritizesHead()
      Retrieves whether homing prioritizes the target's head/eye position.
      Returns:
      true if prioritizing head, false otherwise.
    • enchantment_core$getHomingArmingDistance

      double enchantment_core$getHomingArmingDistance()
      Retrieves the arming distance required before homing activates.
      Returns:
      The arming distance in blocks.
    • enchantment_core$getHomingMinDistance

      double enchantment_core$getHomingMinDistance()
      Retrieves the minimum frustum distance threshold for homing target acquisition.
      Returns:
      The minimum distance in blocks.
    • enchantment_core$getHomingMaxDistance

      double enchantment_core$getHomingMaxDistance()
      Retrieves the maximum frustum distance threshold for homing target acquisition.
      Returns:
      The maximum distance in blocks (defaults to 64.0).
    • enchantment_core$getHomingFov

      double enchantment_core$getHomingFov()
      Retrieves the field-of-view cone angle for homing target acquisition.
      Returns:
      The FOV angle in degrees (defaults to 360.0).
    • enchantment_core$getHomingTurnRate

      double enchantment_core$getHomingTurnRate()
      Retrieves the maximum angular turn rate per tick for homing tracking.
      Returns:
      The turn rate in degrees per tick (defaults to 360.0).
    • enchantment_core$getBouncesRemaining

      int enchantment_core$getBouncesRemaining()
      Retrieves the number of remaining ricochet bounces.
      Returns:
      The remaining bounce count.
    • enchantment_core$getRicochetRetention

      double enchantment_core$getRicochetRetention()
      Retrieves the velocity retention multiplier applied after each ricochet bounce.
      Returns:
      The velocity retention multiplier (defaults to 0.8).
    • enchantment_core$getMagneticStrength

      double enchantment_core$getMagneticStrength()
      Retrieves the magnetic trajectory pull strength.
      Returns:
      The magnetic pull strength (defaults to 0.0).
    • enchantment_core$getMagneticPrioritizesHead

      boolean enchantment_core$getMagneticPrioritizesHead()
      Retrieves whether magnetic pull prioritizes the target's head/eye position.
      Returns:
      true if prioritizing head, false otherwise.
    • enchantment_core$getMagneticArmingDistance

      double enchantment_core$getMagneticArmingDistance()
      Retrieves the arming distance required before the magnetic effect activates.
      Returns:
      The arming distance in blocks.
    • enchantment_core$getMagneticSearchRadius

      double enchantment_core$getMagneticSearchRadius()
      Retrieves the radial target search radius for the magnetic effect.
      Returns:
      The search radius in blocks (defaults to 16.0).
    • enchantment_core$getShrapnelGenerations

      int enchantment_core$getShrapnelGenerations()
      Retrieves the number of recursive shrapnel split generations remaining.
      Returns:
      The remaining generation count.
    • enchantment_core$getShrapnelAmount

      int enchantment_core$getShrapnelAmount()
      Retrieves the number of child shrapnel projectiles spawned per impact.
      Returns:
      The shrapnel projectile count.
    • enchantment_core$getShrapnelSpread

      double enchantment_core$getShrapnelSpread()
      Retrieves the inaccuracy spread angle of spawned shrapnel projectiles.
      Returns:
      The spread angle in degrees.
    • enchantment_core$getShrapnelVelocityRetention

      double enchantment_core$getShrapnelVelocityRetention()
      Retrieves the velocity retention multiplier for spawned shrapnel projectiles.
      Returns:
      The velocity retention multiplier.
    • enchantment_core$getShrapnelDamageRetention

      double enchantment_core$getShrapnelDamageRetention()
      Retrieves the base damage retention multiplier for spawned shrapnel arrows.
      Returns:
      The damage retention multiplier.
    • enchantment_core$getShrapnelTriggerBlock

      boolean enchantment_core$getShrapnelTriggerBlock()
      Retrieves whether shrapnel generation triggers upon block impact.
      Returns:
      true if triggered on block impact, false otherwise.
    • enchantment_core$getShrapnelTriggerEntity

      boolean enchantment_core$getShrapnelTriggerEntity()
      Retrieves whether shrapnel generation triggers upon entity impact.
      Returns:
      true if triggered on entity impact, false otherwise.
    • enchantment_core$isCalculated

      boolean enchantment_core$isCalculated()
      Retrieves whether weapon enchantment modifiers have been evaluated and cached on this projectile.
      Returns:
      true if calculated, false otherwise.