Skip to content

Available API Events

AccessoryChangeCallback

An event which fires when a change for a slot occurs. The event provides the current stack, and the previous stack combined with the type of slot change which occurred. That change can either be MUTATION or REPLACEMENT.

  • MUTATION means that the stack was not unequipped but the NBT data was modified. Usually it is still the same item.
  • REPLACEMENT indicates a setStack() call has occurred on the inventory, leading to the stack being entirely different (usually or always?).

AdjustAttributeModifierCallback

An event used to adjust the attributes of the accessory stack. This is collected from the DataComponent method or from the Accessory#getModifiers call.

AllowEntityModificationCallback

An event used for allowing or restricting access for an entity to modify various aspects of Accessories. Some examples include opening the screen, adjusting accessories, or toggling the visibility of the rendering.

CanEquipCallback

An event used to adjust if the accessory is equippable based on the ItemStack and SlotReference

CanUnequipCallback

An event used to adjust if the accessory can be unequipped based on the ItemStack and SlotReference

ContainersChangeCallback

An event fired when a change occurs for the AccessoryContainer. This happens before the changes are synced. It provides a map of changed containers (AccessoriesContainers) to whether the change was related to resizing (boolean).

OnDropCallback

An event used to adjust the drop rule for the stack when such is being handled after the of the target entity found within AccessoriesEventHandler#onDeath.

OnDeathCallback

An event fired after an entity dies, and after all OnDropCallback have been calculated. This can be used to cancel default dropping behavior, or adjust stack data before dropping the items.

Implemented Events

Any event below can be implemented directly on an Accessory implementation or by registering to the event object within the respective interface.

AllowWalkingOnSnow

An event allowing the ability to adjust if the entity should be able to walk on powdered snow.

EndermanMasked

An event allowing for the control over if the EnderMan entity sees the wearer entity as using a mask item to conceal their eyeballs, preventing them from being angered.

FortuneAdjustment

An event allowing for the adjustment of the level of fortune provided to the entity when calculating for such.

LootingAdjustment

An event allowing for the adjustment of the level of looting provided to the entity when calculating for on the death of an attacked entity.

PiglinNeutralInducer

An event allowing for adjusting if the entity should anger any piglins within range of them.


Last update: 2024-06-27