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 net.kyori.adventure.key.Key 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
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAttributeEffect(@NotNull net.kyori.adventure.key.Key id, @NotNull Attribute attribute, @NotNull LevelBasedValue amount, @NotNull AttributeOperation operation) Creates an instance of aAttributeEffectrecord class. -
Method Summary
Modifier and TypeMethodDescription@NotNull LevelBasedValueamount()Returns the value of theamountrecord component.@NotNull AttributeReturns the value of theattributerecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.@NotNull net.kyori.adventure.key.Keyid()Returns the value of theidrecord component.@NotNull BinaryTagSerializer<AttributeEffect> nbtType()@NotNull AttributeOperationReturns the value of theoperationrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
NBT_TYPE
-
-
Constructor Details
-
AttributeEffect
public AttributeEffect(@NotNull @NotNull net.kyori.adventure.key.Key id, @NotNull @NotNull Attribute attribute, @NotNull @NotNull LevelBasedValue amount, @NotNull @NotNull AttributeOperation operation) Creates an instance of aAttributeEffectrecord class.- Parameters:
id- the value for theidrecord componentattribute- the value for theattributerecord componentamount- the value for theamountrecord componentoperation- the value for theoperationrecord component
-
-
Method Details
-
nbtType
- Specified by:
nbtTypein 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
@NotNull public @NotNull net.kyori.adventure.key.Key id()Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
attribute
Returns the value of theattributerecord component.- Returns:
- the value of the
attributerecord component
-
amount
Returns the value of theamountrecord component.- Returns:
- the value of the
amountrecord component
-
operation
Returns the value of theoperationrecord component.- Returns:
- the value of the
operationrecord component
-