Package net.minestom.server.attribute
Record Class Attribute
java.lang.Object
java.lang.Record
net.minestom.server.attribute.Attribute
Represents a
living entity attribute.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfloatReturns the value of thedefaultValuerecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.key()Returns the value of thekeyrecord component.floatmaxValue()Returns the value of themaxValuerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Attribute
Creates an instance of aAttributerecord class.- Parameters:
key- the value for thekeyrecord componentdefaultValue- the value for thedefaultValuerecord componentmaxValue- the value for themaxValuerecord component
-
-
Method Details
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
key
Returns the value of thekeyrecord component.- Returns:
- the value of the
keyrecord component
-
defaultValue
public float defaultValue()Returns the value of thedefaultValuerecord component.- Returns:
- the value of the
defaultValuerecord component
-
maxValue
public float maxValue()Returns the value of themaxValuerecord component.- Returns:
- the value of the
maxValuerecord component
-