Class ItemAttributeEvent

java.lang.Object
net.minecraftforge.eventbus.internal.MutableEventInternals
net.minecraftforge.eventbus.api.event.MutableEvent
com.stereowalker.unionlib.event.item.ItemAttributeEvent
All Implemented Interfaces:
net.minecraftforge.eventbus.api.event.characteristic.Cancellable, net.minecraftforge.eventbus.internal.Event, net.minecraftforge.eventbus.internal.EventCharacteristic

public class ItemAttributeEvent extends net.minecraftforge.eventbus.api.event.MutableEvent implements net.minecraftforge.eventbus.api.event.characteristic.Cancellable
This event is fired whenever an items attribute modifier is being retrieved
This allows mod authors to add or remove attribute modifiers from vanilla or other modded items
If this event is cancelled, it will give the item an empty attribute map
NOTE: Attributes added via this event do not persist.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final net.minecraftforge.eventbus.api.bus.CancellableEventBus<ItemAttributeEvent>
     

    Fields inherited from class net.minecraftforge.eventbus.internal.MutableEventInternals

    isMonitoring
  • Constructor Summary

    Constructors
    Constructor
    Description
    ItemAttributeEvent(com.google.common.collect.HashMultimap<net.minecraft.world.entity.ai.attributes.Attribute, net.minecraft.world.entity.ai.attributes.AttributeModifier> attributeMap, net.minecraft.world.entity.EquipmentSlot equipmentSlot, net.minecraft.world.item.ItemStack stack)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    com.google.common.collect.HashMultimap<net.minecraft.world.entity.ai.attributes.Attribute, net.minecraft.world.entity.ai.attributes.AttributeModifier>
     
    net.minecraft.world.entity.EquipmentSlot
     
    net.minecraft.world.item.ItemStack
     

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • BUS

      public static final net.minecraftforge.eventbus.api.bus.CancellableEventBus<ItemAttributeEvent> BUS
  • Constructor Details

    • ItemAttributeEvent

      public ItemAttributeEvent(com.google.common.collect.HashMultimap<net.minecraft.world.entity.ai.attributes.Attribute, net.minecraft.world.entity.ai.attributes.AttributeModifier> attributeMap, net.minecraft.world.entity.EquipmentSlot equipmentSlot, net.minecraft.world.item.ItemStack stack)
  • Method Details

    • getEquipmentSlot

      public net.minecraft.world.entity.EquipmentSlot getEquipmentSlot()
    • getStack

      public net.minecraft.world.item.ItemStack getStack()
    • getAttributeMap

      public com.google.common.collect.HashMultimap<net.minecraft.world.entity.ai.attributes.Attribute, net.minecraft.world.entity.ai.attributes.AttributeModifier> getAttributeMap()