Package net.minecraft.component.type
Record Class AttackRangeComponent
java.lang.Object
java.lang.Record
net.minecraft.component.type.AttackRangeComponent
- Record Components:
minRange-maxRange-hitboxMargin-mobFactor-
public record AttackRangeComponent(float minRange, float maxRange, float hitboxMargin, float mobFactor)
extends Record
- Mappings:
Namespace Name named net/minecraft/component/type/AttackRangeComponentintermediary net/minecraft/class_12392official dnunamed minRangeintermediary comp_5260official dnamed maxRangeintermediary comp_5261official enamed hitboxMarginintermediary comp_5262official fnamed mobFactorintermediary comp_5263official g
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<AttackRangeComponent> static final AttackRangeComponentprivate final floatThe field for thehitboxMarginrecord component.private final floatThe field for themaxRangerecord component.private final floatThe field for theminRangerecord component.private final floatThe field for themobFactorrecord component.static final PacketCodec<ByteBuf, AttackRangeComponent> -
Constructor Summary
ConstructorsConstructorDescriptionAttackRangeComponent(float minRange, float maxRange, float hitboxMargin, float mobFactor) Creates an instance of aAttackRangeComponentrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic AttackRangeComponentdefaultForEntity(LivingEntity entity) final booleanIndicates whether some other object is "equal to" this one.doublegetEffectiveMaxRange(Entity entity) doublegetEffectiveMinRange(Entity entity) getHitResult(Entity entity, float tickProgress, Predicate<Entity> hitPredicate) final inthashCode()Returns a hash code value for this object.floatReturns the value of thehitboxMarginrecord component.private booleanisWithinRange(LivingEntity entity, ToDoubleFunction<Vec3d> squaredDistanceFunction, double extraHitboxMargin) booleanisWithinRange(LivingEntity entity, Box box, double extraHitboxMargin) booleanisWithinRange(LivingEntity entity, Vec3d pos) floatmaxRange()Returns the value of themaxRangerecord component.floatminRange()Returns the value of theminRangerecord component.floatReturns the value of themobFactorrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
minRange
private final float minRangeThe field for theminRangerecord component. -
maxRange
private final float maxRangeThe field for themaxRangerecord component. -
hitboxMargin
private final float hitboxMarginThe field for thehitboxMarginrecord component. -
mobFactor
private final float mobFactorThe field for themobFactorrecord component. -
DEFAULT
- Mappings:
Namespace Name Mixin selector named DEFAULTLnet/minecraft/component/type/AttackRangeComponent;DEFAULT:Lnet/minecraft/component/type/AttackRangeComponent;intermediary field_64653Lnet/minecraft/class_12392;field_64653:Lnet/minecraft/class_12392;official aLdnu;a:Ldnu;
-
CODEC
- Mappings:
Namespace Name Mixin selector named CODECLnet/minecraft/component/type/AttackRangeComponent;CODEC:Lcom/mojang/serialization/Codec;intermediary field_64654Lnet/minecraft/class_12392;field_64654:Lcom/mojang/serialization/Codec;official bLdnu;b:Lcom/mojang/serialization/Codec;
-
PACKET_CODEC
- Mappings:
Namespace Name Mixin selector named PACKET_CODECLnet/minecraft/component/type/AttackRangeComponent;PACKET_CODEC:Lnet/minecraft/network/codec/PacketCodec;intermediary field_64655Lnet/minecraft/class_12392;field_64655:Lnet/minecraft/class_9139;official cLdnu;c:Laao;
-
-
Constructor Details
-
AttackRangeComponent
public AttackRangeComponent(float minRange, float maxRange, float hitboxMargin, float mobFactor) Creates an instance of aAttackRangeComponentrecord class.- Parameters:
minRange- the value for theminRangerecord componentmaxRange- the value for themaxRangerecord componenthitboxMargin- the value for thehitboxMarginrecord componentmobFactor- the value for themobFactorrecord component
-
-
Method Details
-
defaultForEntity
- Mappings:
Namespace Name Mixin selector named defaultForEntityLnet/minecraft/component/type/AttackRangeComponent;defaultForEntity(Lnet/minecraft/entity/LivingEntity;)Lnet/minecraft/component/type/AttackRangeComponent;intermediary method_76734Lnet/minecraft/class_12392;method_76734(Lnet/minecraft/class_1309;)Lnet/minecraft/class_12392;official aLdnu;a(Lchl;)Ldnu;
-
getHitResult
- Mappings:
Namespace Name Mixin selector named getHitResultLnet/minecraft/component/type/AttackRangeComponent;getHitResult(Lnet/minecraft/entity/Entity;FLjava/util/function/Predicate;)Lnet/minecraft/util/hit/HitResult;intermediary method_76733Lnet/minecraft/class_12392;method_76733(Lnet/minecraft/class_1297;FLjava/util/function/Predicate;)Lnet/minecraft/class_239;official aLdnu;a(Lcgk;FLjava/util/function/Predicate;)Lftk;
-
getEffectiveMinRange
- Mappings:
Namespace Name Mixin selector named getEffectiveMinRangeLnet/minecraft/component/type/AttackRangeComponent;getEffectiveMinRange(Lnet/minecraft/entity/Entity;)Dintermediary method_76732Lnet/minecraft/class_12392;method_76732(Lnet/minecraft/class_1297;)Dofficial aLdnu;a(Lcgk;)D
-
getEffectiveMaxRange
- Mappings:
Namespace Name Mixin selector named getEffectiveMaxRangeLnet/minecraft/component/type/AttackRangeComponent;getEffectiveMaxRange(Lnet/minecraft/entity/Entity;)Dintermediary method_76739Lnet/minecraft/class_12392;method_76739(Lnet/minecraft/class_1297;)Dofficial bLdnu;b(Lcgk;)D
-
isWithinRange
- Mappings:
Namespace Name Mixin selector named isWithinRangeLnet/minecraft/component/type/AttackRangeComponent;isWithinRange(Lnet/minecraft/entity/LivingEntity;Lnet/minecraft/util/math/Vec3d;)Zintermediary method_76736Lnet/minecraft/class_12392;method_76736(Lnet/minecraft/class_1309;Lnet/minecraft/class_243;)Zofficial aLdnu;a(Lchl;Lftm;)Z
-
isWithinRange
- Mappings:
Namespace Name Mixin selector named isWithinRangeLnet/minecraft/component/type/AttackRangeComponent;isWithinRange(Lnet/minecraft/entity/LivingEntity;Lnet/minecraft/util/math/Box;D)Zintermediary method_76735Lnet/minecraft/class_12392;method_76735(Lnet/minecraft/class_1309;Lnet/minecraft/class_238;D)Zofficial aLdnu;a(Lchl;Lfth;D)Z
-
isWithinRange
private boolean isWithinRange(LivingEntity entity, ToDoubleFunction<Vec3d> squaredDistanceFunction, double extraHitboxMargin) - Mappings:
Namespace Name Mixin selector named isWithinRangeLnet/minecraft/component/type/AttackRangeComponent;isWithinRange(Lnet/minecraft/entity/LivingEntity;Ljava/util/function/ToDoubleFunction;D)Zintermediary method_76737Lnet/minecraft/class_12392;method_76737(Lnet/minecraft/class_1309;Ljava/util/function/ToDoubleFunction;D)Zofficial aLdnu;a(Lchl;Ljava/util/function/ToDoubleFunction;D)Z
-
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. -
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. -
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. All components in this record class are compared with '=='. -
minRange
public float minRange()Returns the value of theminRangerecord component.- Returns:
- the value of the
minRangerecord component
-
maxRange
public float maxRange()Returns the value of themaxRangerecord component.- Returns:
- the value of the
maxRangerecord component
-
hitboxMargin
public float hitboxMargin()Returns the value of thehitboxMarginrecord component.- Returns:
- the value of the
hitboxMarginrecord component
-
mobFactor
public float mobFactor()Returns the value of themobFactorrecord component.- Returns:
- the value of the
mobFactorrecord component
-