Record Class HomingProjectileEffect

java.lang.Object
java.lang.Record
johnsmith.enchantmentcore.api.enchantment.effect.projectile.HomingProjectileEffect
Record Components:
trackingStrength - The LevelBasedValue governing 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 - The LevelBasedValue minimum distance (in blocks) the projectile must travel before homing activates.
minDistance - The LevelBasedValue near-clipping plane distance for the target acquisition frustum.
maxDistance - The LevelBasedValue far-clipping plane distance for the target acquisition frustum.
fov - The LevelBasedValue field-of-view cone angle in degrees for target acquisition.
turnRate - The LevelBasedValue maximum 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

    Fields
    Modifier and Type
    Field
    Description
    static final String
    JSON field key for the minimum arming distance in blocks.
    static final com.mojang.serialization.Codec<HomingProjectileEffect>
    Codec for serializing and deserializing HomingProjectileEffect instances from JSON.
    static final String
    JSON field key for the target acquisition field-of-view cone in degrees.
    static final String
    Registry path identifier for this projectile effect component.
    Supplies the JSON property keys holding LevelBasedValue definitions for data transformation.
    static final String
    JSON field key for the maximum target acquisition distance.
    static final String
    JSON field key for the minimum target acquisition distance.
    static final String
    JSON field key for prioritizing target eye height.
    static final String
    JSON field key for the homing steering strength.
    static final String
    JSON field key for the maximum turn rate in degrees per tick.
  • Constructor Summary

    Constructors
    Constructor
    Description
    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 a HomingProjectileEffect record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    net.minecraft.world.item.enchantment.LevelBasedValue
    Returns the value of the armingDistance record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    net.minecraft.world.item.enchantment.LevelBasedValue
    fov()
    Returns the value of the fov record component.
    final int
    Returns a hash code value for this object.
    net.minecraft.world.item.enchantment.LevelBasedValue
    Returns the value of the maxDistance record component.
    net.minecraft.world.item.enchantment.LevelBasedValue
    Returns the value of the minDistance record component.
    boolean
    Returns the value of the prioritizeHead record component.
    final String
    Returns a string representation of this record class.
    net.minecraft.world.item.enchantment.LevelBasedValue
    Returns the value of the trackingStrength record component.
    net.minecraft.world.item.enchantment.LevelBasedValue
    Returns the value of the turnRate record component.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • TRACKING_STRENGTH

      public static final String TRACKING_STRENGTH
      JSON field key for the homing steering strength.
      See Also:
    • PRIORITIZE_HEAD

      public static final String PRIORITIZE_HEAD
      JSON field key for prioritizing target eye height.
      See Also:
    • ARMING_DISTANCE

      public static final String ARMING_DISTANCE
      JSON field key for the minimum arming distance in blocks.
      See Also:
    • MIN_DISTANCE

      public static final String MIN_DISTANCE
      JSON field key for the minimum target acquisition distance.
      See Also:
    • MAX_DISTANCE

      public static final String MAX_DISTANCE
      JSON field key for the maximum target acquisition distance.
      See Also:
    • FOV

      public static final String FOV
      JSON field key for the target acquisition field-of-view cone in degrees.
      See Also:
    • TURN_RATE

      public static final String TURN_RATE
      JSON field key for the maximum turn rate in degrees per tick.
      See Also:
    • KEY

      public static final String KEY
      Registry path identifier for this projectile effect component.
      See Also:
    • KEY_PROVIDER

      public static final LevelBasedKeyProvider KEY_PROVIDER
      Supplies the JSON property keys holding LevelBasedValue definitions for data transformation.
    • CODEC

      public static final com.mojang.serialization.Codec<HomingProjectileEffect> CODEC
      Codec for serializing and deserializing HomingProjectileEffect instances 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 a HomingProjectileEffect record class.
      Parameters:
      trackingStrength - the value for the trackingStrength record component
      prioritizeHead - the value for the prioritizeHead record component
      armingDistance - the value for the armingDistance record component
      minDistance - the value for the minDistance record component
      maxDistance - the value for the maxDistance record component
      fov - the value for the fov record component
      turnRate - the value for the turnRate record component
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • trackingStrength

      public net.minecraft.world.item.enchantment.LevelBasedValue trackingStrength()
      Returns the value of the trackingStrength record component.
      Returns:
      the value of the trackingStrength record component
    • prioritizeHead

      public boolean prioritizeHead()
      Returns the value of the prioritizeHead record component.
      Returns:
      the value of the prioritizeHead record component
    • armingDistance

      public net.minecraft.world.item.enchantment.LevelBasedValue armingDistance()
      Returns the value of the armingDistance record component.
      Returns:
      the value of the armingDistance record component
    • minDistance

      public net.minecraft.world.item.enchantment.LevelBasedValue minDistance()
      Returns the value of the minDistance record component.
      Returns:
      the value of the minDistance record component
    • maxDistance

      public net.minecraft.world.item.enchantment.LevelBasedValue maxDistance()
      Returns the value of the maxDistance record component.
      Returns:
      the value of the maxDistance record component
    • fov

      public net.minecraft.world.item.enchantment.LevelBasedValue fov()
      Returns the value of the fov record component.
      Returns:
      the value of the fov record component
    • turnRate

      public net.minecraft.world.item.enchantment.LevelBasedValue turnRate()
      Returns the value of the turnRate record component.
      Returns:
      the value of the turnRate record component