Record Class AttackRangeComponent

java.lang.Object
java.lang.Record
net.minecraft.component.type.AttackRangeComponent
Record Components:
minRange -
maxRange -
minCreativeRange -
maxCreativeRange -
hitboxMargin -
mobFactor -

public record AttackRangeComponent(float minRange, float maxRange, float minCreativeRange, float maxCreativeRange, float hitboxMargin, float mobFactor) extends Record
Mappings:
Namespace Name
named net/minecraft/component/type/AttackRangeComponent
intermediary net/minecraft/class_12392
official dnu
named minRange
intermediary comp_5260
official c
named maxRange
intermediary comp_5261
official d
named minCreativeRange
intermediary comp_5265
official e
named maxCreativeRange
intermediary comp_5266
official f
named hitboxMargin
intermediary comp_5262
official g
named mobFactor
intermediary comp_5263
official h
  • Field Details

    • minRange

      private final float minRange
      The field for the minRange record component.
    • maxRange

      private final float maxRange
      The field for the maxRange record component.
    • minCreativeRange

      private final float minCreativeRange
      The field for the minCreativeRange record component.
    • maxCreativeRange

      private final float maxCreativeRange
      The field for the maxCreativeRange record component.
    • hitboxMargin

      private final float hitboxMargin
      The field for the hitboxMargin record component.
    • mobFactor

      private final float mobFactor
      The field for the mobFactor record component.
    • CODEC

      public static final com.mojang.serialization.Codec<AttackRangeComponent> CODEC
      Mappings:
      Namespace Name Mixin selector
      named CODEC Lnet/minecraft/component/type/AttackRangeComponent;CODEC:Lcom/mojang/serialization/Codec;
      intermediary field_64654 Lnet/minecraft/class_12392;field_64654:Lcom/mojang/serialization/Codec;
      official a Ldnu;a:Lcom/mojang/serialization/Codec;
    • PACKET_CODEC

      public static final PacketCodec<ByteBuf,AttackRangeComponent> PACKET_CODEC
      Mappings:
      Namespace Name Mixin selector
      named PACKET_CODEC Lnet/minecraft/component/type/AttackRangeComponent;PACKET_CODEC:Lnet/minecraft/network/codec/PacketCodec;
      intermediary field_64655 Lnet/minecraft/class_12392;field_64655:Lnet/minecraft/class_9139;
      official b Ldnu;b:Laao;
  • Constructor Details

    • AttackRangeComponent

      public AttackRangeComponent(float minRange, float maxRange, float minCreativeRange, float maxCreativeRange, float hitboxMargin, float mobFactor)
      Creates an instance of a AttackRangeComponent record class.
      Parameters:
      minRange - the value for the minRange record component
      maxRange - the value for the maxRange record component
      minCreativeRange - the value for the minCreativeRange record component
      maxCreativeRange - the value for the maxCreativeRange record component
      hitboxMargin - the value for the hitboxMargin record component
      mobFactor - the value for the mobFactor record component
  • Method Details

    • defaultForEntity

      public static AttackRangeComponent defaultForEntity(LivingEntity entity)
      Mappings:
      Namespace Name Mixin selector
      named defaultForEntity Lnet/minecraft/component/type/AttackRangeComponent;defaultForEntity(Lnet/minecraft/entity/LivingEntity;)Lnet/minecraft/component/type/AttackRangeComponent;
      intermediary method_76734 Lnet/minecraft/class_12392;method_76734(Lnet/minecraft/class_1309;)Lnet/minecraft/class_12392;
      official a Ldnu;a(Lchl;)Ldnu;
    • getHitResult

      public HitResult getHitResult(Entity entity, float tickProgress, Predicate<Entity> hitPredicate)
      Mappings:
      Namespace Name Mixin selector
      named getHitResult Lnet/minecraft/component/type/AttackRangeComponent;getHitResult(Lnet/minecraft/entity/Entity;FLjava/util/function/Predicate;)Lnet/minecraft/util/hit/HitResult;
      intermediary method_76733 Lnet/minecraft/class_12392;method_76733(Lnet/minecraft/class_1297;FLjava/util/function/Predicate;)Lnet/minecraft/class_239;
      official a Ldnu;a(Lcgk;FLjava/util/function/Predicate;)Lftk;
    • getEffectiveMinRange

      public float getEffectiveMinRange(Entity entity)
      Mappings:
      Namespace Name Mixin selector
      named getEffectiveMinRange Lnet/minecraft/component/type/AttackRangeComponent;getEffectiveMinRange(Lnet/minecraft/entity/Entity;)F
      intermediary method_76732 Lnet/minecraft/class_12392;method_76732(Lnet/minecraft/class_1297;)F
      official a Ldnu;a(Lcgk;)F
    • getEffectiveMaxRange

      public float getEffectiveMaxRange(Entity entity)
      Mappings:
      Namespace Name Mixin selector
      named getEffectiveMaxRange Lnet/minecraft/component/type/AttackRangeComponent;getEffectiveMaxRange(Lnet/minecraft/entity/Entity;)F
      intermediary method_76739 Lnet/minecraft/class_12392;method_76739(Lnet/minecraft/class_1297;)F
      official b Ldnu;b(Lcgk;)F
    • isWithinRange

      public boolean isWithinRange(LivingEntity entity, Vec3d pos)
      Mappings:
      Namespace Name Mixin selector
      named isWithinRange Lnet/minecraft/component/type/AttackRangeComponent;isWithinRange(Lnet/minecraft/entity/LivingEntity;Lnet/minecraft/util/math/Vec3d;)Z
      intermediary method_76736 Lnet/minecraft/class_12392;method_76736(Lnet/minecraft/class_1309;Lnet/minecraft/class_243;)Z
      official a Ldnu;a(Lchl;Lftm;)Z
    • isWithinRange

      public boolean isWithinRange(LivingEntity entity, Box box, double extraHitboxMargin)
      Mappings:
      Namespace Name Mixin selector
      named isWithinRange Lnet/minecraft/component/type/AttackRangeComponent;isWithinRange(Lnet/minecraft/entity/LivingEntity;Lnet/minecraft/util/math/Box;D)Z
      intermediary method_76735 Lnet/minecraft/class_12392;method_76735(Lnet/minecraft/class_1309;Lnet/minecraft/class_238;D)Z
      official a Ldnu;a(Lchl;Lfth;D)Z
    • isWithinRange

      private boolean isWithinRange(LivingEntity entity, ToDoubleFunction<Vec3d> squaredDistanceFunction, double extraHitboxMargin)
      Mappings:
      Namespace Name Mixin selector
      named isWithinRange Lnet/minecraft/component/type/AttackRangeComponent;isWithinRange(Lnet/minecraft/entity/LivingEntity;Ljava/util/function/ToDoubleFunction;D)Z
      intermediary method_76737 Lnet/minecraft/class_12392;method_76737(Lnet/minecraft/class_1309;Ljava/util/function/ToDoubleFunction;D)Z
      official a Ldnu;a(Lchl;Ljava/util/function/ToDoubleFunction;D)Z
    • 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 object)
      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. All components in this record class are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      object - the object with which to compare
      Returns:
      true if this object is the same as the object argument; false otherwise.
    • minRange

      public float minRange()
      Returns the value of the minRange record component.
      Returns:
      the value of the minRange record component
    • maxRange

      public float maxRange()
      Returns the value of the maxRange record component.
      Returns:
      the value of the maxRange record component
    • minCreativeRange

      public float minCreativeRange()
      Returns the value of the minCreativeRange record component.
      Returns:
      the value of the minCreativeRange record component
    • maxCreativeRange

      public float maxCreativeRange()
      Returns the value of the maxCreativeRange record component.
      Returns:
      the value of the maxCreativeRange record component
    • hitboxMargin

      public float hitboxMargin()
      Returns the value of the hitboxMargin record component.
      Returns:
      the value of the hitboxMargin record component
    • mobFactor

      public float mobFactor()
      Returns the value of the mobFactor record component.
      Returns:
      the value of the mobFactor record component