Interface ProjectileStateAccessor
- All Superinterfaces:
EntityStateAccessor
- All Known Implementing Classes:
StateDeclarationMixin
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 Summary
Modifier and TypeMethodDescriptionintRetrieves the number of remaining ricochet bounces.doubleRetrieves the active aerodynamic drag multiplier.doubleRetrieves the arming distance required before homing activates.doubleRetrieves the field-of-view cone angle for homing target acquisition.doubleRetrieves the maximum frustum distance threshold for homing target acquisition.doubleRetrieves the minimum frustum distance threshold for homing target acquisition.booleanRetrieves whether homing prioritizes the target's head/eye position.doubleRetrieves the homing tracking strength.doubleRetrieves the maximum angular turn rate per tick for homing tracking.doubleRetrieves the arming distance required before the magnetic effect activates.booleanRetrieves whether magnetic pull prioritizes the target's head/eye position.doubleRetrieves the radial target search radius for the magnetic effect.doubleRetrieves the magnetic trajectory pull strength.doubleRetrieves the velocity retention multiplier applied after each ricochet bounce.intRetrieves the number of child shrapnel projectiles spawned per impact.doubleRetrieves the base damage retention multiplier for spawned shrapnel arrows.intRetrieves the number of recursive shrapnel split generations remaining.doubleRetrieves the inaccuracy spread angle of spawned shrapnel projectiles.booleanRetrieves whether shrapnel generation triggers upon block impact.booleanRetrieves whether shrapnel generation triggers upon entity impact.doubleRetrieves the velocity retention multiplier for spawned shrapnel projectiles.booleanRetrieves whether weapon enchantment modifiers have been evaluated and cached on this projectile.voidenchantment_core$setBouncesRemaining(int bounces) Sets the number of block-surface ricochet bounces remaining for the projectile.voidenchantment_core$setCalculated(boolean calculated) Sets the state lock flag indicating whether weapon enchantment modifiers have been evaluated and cached on this projectile.voidenchantment_core$setDragMultiplier(double multiplier) Sets the multiplier applied to the projectile's base aerodynamic/fluid velocity retention factor.voidenchantment_core$setHomingArmingDistance(double distance) Sets the minimum distance (in blocks) the projectile must travel from its spawn point before homing activates.voidenchantment_core$setHomingFov(double fov) Sets the field-of-view cone angle (in degrees) restricting homing target acquisition.voidenchantment_core$setHomingMaxDistance(double distance) Sets the far-clipping plane distance (in blocks) of the homing target acquisition frustum.voidenchantment_core$setHomingMinDistance(double distance) Sets the near-clipping plane distance (in blocks) of the homing target acquisition frustum.voidenchantment_core$setHomingPrioritizesHead(boolean prioritizesHead) Sets whether homing steering aims for the target's eye height instead of its bounding box center.voidenchantment_core$setHomingStrength(double strength) Sets the steering interpolation strength applied when tracking a homing target.voidenchantment_core$setHomingTurnRate(double turnRate) Sets the maximum angular rotation (in degrees per tick) the projectile can turn during homing.voidenchantment_core$setMagneticArmingDistance(double distance) Sets the minimum distance (in blocks) the projectile must travel before magnetic attraction activates.voidenchantment_core$setMagneticPrioritizesHead(boolean head) Sets whether magnetic trajectory attraction aims for the target's eye height.voidenchantment_core$setMagneticSearchRadius(double radius) Sets the radial search distance (in blocks) within which candidate targets are evaluated for magnetism.voidenchantment_core$setMagneticStrength(double strength) Sets the attractive pull strength steering the projectile toward nearby magnetic targets.voidenchantment_core$setRicochetRetention(double retention) Sets the fraction of velocity magnitude retained after a ricochet bounce.voidenchantment_core$setShrapnelAmount(int amount) Sets the number of child shrapnel projectiles spawned per fracture event.voidenchantment_core$setShrapnelDamageRetention(double retention) Sets the fraction of the parent arrow's base damage inherited by spawned shrapnel arrows.voidenchantment_core$setShrapnelGenerations(int generations) Sets the number of recursive shrapnel split generations remaining upon impact.voidenchantment_core$setShrapnelSpread(double spread) Sets the inaccuracy cone spread angle (in degrees) applied to spawned shrapnel projectiles.voidenchantment_core$setShrapnelTriggerBlock(boolean trigger) Sets whether impacting a block triggers shrapnel fracturing.voidenchantment_core$setShrapnelTriggerEntity(boolean trigger) Sets whether impacting an entity triggers shrapnel fracturing.voidenchantment_core$setShrapnelVelocityRetention(double retention) Sets the fraction of the parent projectile's speed inherited by spawned shrapnel projectiles.Methods inherited from interface EntityStateAccessor
enchantment_core$getGravityMultiplier, enchantment_core$setGravityMultiplier
-
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-trueto prioritize the head/eyes,falsefor 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-trueto target the head/eyes,falsefor 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-trueto trigger on block impact,falseotherwise.
-
enchantment_core$setShrapnelTriggerEntity
void enchantment_core$setShrapnelTriggerEntity(boolean trigger) Sets whether impacting an entity triggers shrapnel fracturing.- Parameters:
trigger-trueto trigger on entity impact,falseotherwise.
-
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-trueonce initial evaluation is complete,falseotherwise.
-
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:
trueif prioritizing head,falseotherwise.
-
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:
trueif prioritizing head,falseotherwise.
-
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:
trueif triggered on block impact,falseotherwise.
-
enchantment_core$getShrapnelTriggerEntity
boolean enchantment_core$getShrapnelTriggerEntity()Retrieves whether shrapnel generation triggers upon entity impact.- Returns:
trueif triggered on entity impact,falseotherwise.
-
enchantment_core$isCalculated
boolean enchantment_core$isCalculated()Retrieves whether weapon enchantment modifiers have been evaluated and cached on this projectile.- Returns:
trueif calculated,falseotherwise.
-