ItemAttributeModifierEvent
Importing the class
If you need to reference this type directly, like when casting an Array, or as a parameter, you will need to import it. Simply add the import at the top of the file.
Description
This event is fired when the attributes for an ItemStack are being calculated. Attributes are calculated on the server when equipping and un-equipping an item to add and remove attributes respectively, both must be consistent. Attributes are calculated on the client when rendering an item's tooltip to show relevant attributes.Extends
ItemAttributeModifierEvent extends Event
.
Listening to the event
This event can be listened to like so:
Members
Returns: True if the modifier was added. False otherwise.
Parameters:
name: string
Type: string
- The name of the modifier to add value: double
Type: double
- The value of the modifier.
Return Type:
bool
Returns: True if the modifier was added. False otherwise.
Parameters:
uuid: string
Type: string
- The UUID of the modifier. name: string
Type: string
- The name of the modifier. value: double
Type: double
- The value of the modifier.
Return Type:
bool
Return Type:
bool
Return Type:
bool
Return Type:
IItemStack
Return Type:
List<AttributeModifier>[Attribute]
Return Type:
List<AttributeModifier>[Attribute]
Returns: A List of the AttributeModifiers for the removed Attribute.
Return Type:
List<AttributeModifier>
Returns: True if the modifier was remove. False otherwise.
Parameters:
Return Type:
bool
Return Type:
EventResult
Parameters:
result: EventResult
Type: EventResult
Return Type:
EventResult
Parameters:
result: EventResult
Type: EventResult
allow
default
deny
If you only want to add / remove a modifier from a specific slot, you can use this to filter based on the slot.
Return Type:
EquipmentSlot