Record Class AttackRange
java.lang.Object
java.lang.Record
net.minestom.server.item.component.AttackRange
public record AttackRange(float minReach, float maxReach, float minCreativeReach, float maxCreativeReach, float hitboxMargin, float mobFactor)
extends Record
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Codec<AttackRange> static final NetworkBuffer.Type<AttackRange> -
Constructor Summary
ConstructorsConstructorDescriptionAttackRange(float minReach, float maxReach, float minCreativeReach, float maxCreativeReach, float hitboxMargin, float mobFactor) Creates an instance of aAttackRangerecord class. -
Method Summary
Modifier and TypeMethodDescriptionfloateffectiveMaxReach(Entity entity) floateffectiveMinReach(Entity entity) final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.floatReturns the value of thehitboxMarginrecord component.floatReturns the value of themaxCreativeReachrecord component.floatmaxReach()Returns the value of themaxReachrecord component.floatReturns the value of theminCreativeReachrecord component.floatminReach()Returns the value of theminReachrecord component.floatReturns the value of themobFactorrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
NETWORK_TYPE
-
CODEC
-
-
Constructor Details
-
AttackRange
public AttackRange(float minReach, float maxReach, float minCreativeReach, float maxCreativeReach, float hitboxMargin, float mobFactor) Creates an instance of aAttackRangerecord class.- Parameters:
minReach- the value for theminReachrecord componentmaxReach- the value for themaxReachrecord componentminCreativeReach- the value for theminCreativeReachrecord componentmaxCreativeReach- the value for themaxCreativeReachrecord componenthitboxMargin- the value for thehitboxMarginrecord componentmobFactor- the value for themobFactorrecord component
-
-
Method Details
-
effectiveMinReach
-
effectiveMaxReach
-
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. All components in this record class are compared with thecomparemethod from their corresponding wrapper classes. -
minReach
public float minReach()Returns the value of theminReachrecord component.- Returns:
- the value of the
minReachrecord component
-
maxReach
public float maxReach()Returns the value of themaxReachrecord component.- Returns:
- the value of the
maxReachrecord component
-
minCreativeReach
public float minCreativeReach()Returns the value of theminCreativeReachrecord component.- Returns:
- the value of the
minCreativeReachrecord component
-
maxCreativeReach
public float maxCreativeReach()Returns the value of themaxCreativeReachrecord component.- Returns:
- the value of the
maxCreativeReachrecord 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
-