Record Class HomingProjectileEffect
java.lang.Object
java.lang.Record
johnsmith.enchantmentcore.api.enchantment.effect.projectile.HomingProjectileEffect
- Record Components:
trackingStrength- TheLevelBasedValuegoverning how aggressively the projectile turns toward the target angle.prioritizeHead- Whether homing aims for the target's eye position rather than the bounding box center.armingDistance- TheLevelBasedValueminimum distance (in blocks) the projectile must travel before homing activates.minDistance- TheLevelBasedValuenear-clipping plane distance for the target acquisition frustum.maxDistance- TheLevelBasedValuefar-clipping plane distance for the target acquisition frustum.fov- TheLevelBasedValuefield-of-view cone angle in degrees for target acquisition.turnRate- TheLevelBasedValuemaximum angular rotation in degrees per tick.
public record HomingProjectileEffect(net.minecraft.world.item.enchantment.LevelBasedValue trackingStrength, boolean prioritizeHead, net.minecraft.world.item.enchantment.LevelBasedValue armingDistance, net.minecraft.world.item.enchantment.LevelBasedValue minDistance, net.minecraft.world.item.enchantment.LevelBasedValue maxDistance, net.minecraft.world.item.enchantment.LevelBasedValue fov, net.minecraft.world.item.enchantment.LevelBasedValue turnRate)
extends Record
Data-driven projectile enchantment effect component that enables fired projectiles to acquire targets
within a forward-facing view frustum and smoothly steer their velocity vector toward the locked target.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringJSON field key for the minimum arming distance in blocks.static final com.mojang.serialization.Codec<HomingProjectileEffect> Codec for serializing and deserializingHomingProjectileEffectinstances from JSON.static final StringJSON field key for the target acquisition field-of-view cone in degrees.static final StringRegistry path identifier for this projectile effect component.static final LevelBasedKeyProviderSupplies the JSON property keys holdingLevelBasedValuedefinitions for data transformation.static final StringJSON field key for the maximum target acquisition distance.static final StringJSON field key for the minimum target acquisition distance.static final StringJSON field key for prioritizing target eye height.static final StringJSON field key for the homing steering strength.static final StringJSON field key for the maximum turn rate in degrees per tick. -
Constructor Summary
ConstructorsConstructorDescriptionHomingProjectileEffect(net.minecraft.world.item.enchantment.LevelBasedValue trackingStrength, boolean prioritizeHead, net.minecraft.world.item.enchantment.LevelBasedValue armingDistance, net.minecraft.world.item.enchantment.LevelBasedValue minDistance, net.minecraft.world.item.enchantment.LevelBasedValue maxDistance, net.minecraft.world.item.enchantment.LevelBasedValue fov, net.minecraft.world.item.enchantment.LevelBasedValue turnRate) Creates an instance of aHomingProjectileEffectrecord class. -
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.world.item.enchantment.LevelBasedValueReturns the value of thearmingDistancerecord component.final booleanIndicates whether some other object is "equal to" this one.net.minecraft.world.item.enchantment.LevelBasedValuefov()Returns the value of thefovrecord component.final inthashCode()Returns a hash code value for this object.net.minecraft.world.item.enchantment.LevelBasedValueReturns the value of themaxDistancerecord component.net.minecraft.world.item.enchantment.LevelBasedValueReturns the value of theminDistancerecord component.booleanReturns the value of theprioritizeHeadrecord component.final StringtoString()Returns a string representation of this record class.net.minecraft.world.item.enchantment.LevelBasedValueReturns the value of thetrackingStrengthrecord component.net.minecraft.world.item.enchantment.LevelBasedValueturnRate()Returns the value of theturnRaterecord component.
-
Field Details
-
TRACKING_STRENGTH
JSON field key for the homing steering strength.- See Also:
-
PRIORITIZE_HEAD
JSON field key for prioritizing target eye height.- See Also:
-
ARMING_DISTANCE
JSON field key for the minimum arming distance in blocks.- See Also:
-
MIN_DISTANCE
JSON field key for the minimum target acquisition distance.- See Also:
-
MAX_DISTANCE
JSON field key for the maximum target acquisition distance.- See Also:
-
FOV
JSON field key for the target acquisition field-of-view cone in degrees.- See Also:
-
TURN_RATE
JSON field key for the maximum turn rate in degrees per tick.- See Also:
-
KEY
Registry path identifier for this projectile effect component.- See Also:
-
KEY_PROVIDER
Supplies the JSON property keys holdingLevelBasedValuedefinitions for data transformation. -
CODEC
Codec for serializing and deserializingHomingProjectileEffectinstances from JSON.
-
-
Constructor Details
-
HomingProjectileEffect
public HomingProjectileEffect(net.minecraft.world.item.enchantment.LevelBasedValue trackingStrength, boolean prioritizeHead, net.minecraft.world.item.enchantment.LevelBasedValue armingDistance, net.minecraft.world.item.enchantment.LevelBasedValue minDistance, net.minecraft.world.item.enchantment.LevelBasedValue maxDistance, net.minecraft.world.item.enchantment.LevelBasedValue fov, net.minecraft.world.item.enchantment.LevelBasedValue turnRate) Creates an instance of aHomingProjectileEffectrecord class.- Parameters:
trackingStrength- the value for thetrackingStrengthrecord componentprioritizeHead- the value for theprioritizeHeadrecord componentarmingDistance- the value for thearmingDistancerecord componentminDistance- the value for theminDistancerecord componentmaxDistance- the value for themaxDistancerecord componentfov- the value for thefovrecord componentturnRate- the value for theturnRaterecord component
-
-
Method Details
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
trackingStrength
public net.minecraft.world.item.enchantment.LevelBasedValue trackingStrength()Returns the value of thetrackingStrengthrecord component.- Returns:
- the value of the
trackingStrengthrecord component
-
prioritizeHead
public boolean prioritizeHead()Returns the value of theprioritizeHeadrecord component.- Returns:
- the value of the
prioritizeHeadrecord component
-
armingDistance
public net.minecraft.world.item.enchantment.LevelBasedValue armingDistance()Returns the value of thearmingDistancerecord component.- Returns:
- the value of the
armingDistancerecord component
-
minDistance
public net.minecraft.world.item.enchantment.LevelBasedValue minDistance()Returns the value of theminDistancerecord component.- Returns:
- the value of the
minDistancerecord component
-
maxDistance
public net.minecraft.world.item.enchantment.LevelBasedValue maxDistance()Returns the value of themaxDistancerecord component.- Returns:
- the value of the
maxDistancerecord component
-
fov
-
turnRate
-