Package net.minestom.server.item.enchant
Record Class AttributeEffect
java.lang.Object
java.lang.Record
net.minestom.server.item.enchant.AttributeEffect
- All Implemented Interfaces:
Enchantment.Effect
,LocationEffect
public record AttributeEffect(@NotNull NamespaceID id, @NotNull Attribute attribute, @NotNull LevelBasedValue amount, @NotNull AttributeOperation operation)
extends Record
implements Enchantment.Effect, LocationEffect
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minestom.server.item.enchant.LocationEffect
LocationEffect.AllOf
-
Field Summary
-
Constructor Summary
ConstructorDescriptionAttributeEffect
(@NotNull NamespaceID id, @NotNull Attribute attribute, @NotNull LevelBasedValue amount, @NotNull AttributeOperation operation) Creates an instance of aAttributeEffect
record class. -
Method Summary
Modifier and TypeMethodDescription@NotNull LevelBasedValue
amount()
Returns the value of theamount
record component.@NotNull Attribute
Returns the value of theattribute
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.@NotNull NamespaceID
id()
Returns the value of theid
record component.@NotNull BinaryTagSerializer
<AttributeEffect> nbtType()
@NotNull AttributeOperation
Returns the value of theoperation
record component.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
NBT_TYPE
-
-
Constructor Details
-
AttributeEffect
public AttributeEffect(@NotNull @NotNull NamespaceID id, @NotNull @NotNull Attribute attribute, @NotNull @NotNull LevelBasedValue amount, @NotNull @NotNull AttributeOperation operation) Creates an instance of aAttributeEffect
record class.- Parameters:
id
- the value for theid
record componentattribute
- the value for theattribute
record componentamount
- the value for theamount
record componentoperation
- the value for theoperation
record component
-
-
Method Details
-
nbtType
- Specified by:
nbtType
in interfaceLocationEffect
-
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 withObjects::equals(Object,Object)
. -
id
Returns the value of theid
record component.- Returns:
- the value of the
id
record component
-
attribute
Returns the value of theattribute
record component.- Returns:
- the value of the
attribute
record component
-
amount
Returns the value of theamount
record component.- Returns:
- the value of the
amount
record component
-
operation
Returns the value of theoperation
record component.- Returns:
- the value of the
operation
record component
-