Class ItemUpdateEvent

java.lang.Object
valorless.rarespawns.events.ItemUpdateEvent
All Implemented Interfaces:
org.bukkit.event.Listener

public class ItemUpdateEvent extends Object implements org.bukkit.event.Listener
Listener that keeps rare item metadata up to date across common inventory events.

Triggers ItemBuilder.updateItem for items when players join, open/close/click inventories, or when a player picks up an item. This ensures custom data and formatting on rare items stays consistent.

  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    Registers this listener with the server's plugin manager.
    void
    onEntityPickupItem(org.bukkit.event.entity.EntityPickupItemEvent event)
    Updates a picked-up item if the entity is a player.
    void
    onInventoryClick(org.bukkit.event.inventory.InventoryClickEvent event)
    Updates all items in the player's bottom inventory when they click inside any inventory view.
    void
    onInventoryClose(org.bukkit.event.inventory.InventoryCloseEvent event)
    Updates all items in the player's bottom inventory when they close an inventory.
    void
    onInventoryOpen(org.bukkit.event.inventory.InventoryOpenEvent event)
    Updates all items in the player's bottom inventory when they open an inventory.
    void
    onPlayerJoin(org.bukkit.event.player.PlayerJoinEvent event)
    Updates all items in a player's inventory when they join the server.

    Methods inherited from class java.lang.Object

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

    • ItemUpdateEvent

      public ItemUpdateEvent()
  • Method Details

    • init

      public static void init()
      Registers this listener with the server's plugin manager.
    • onEntityPickupItem

      public void onEntityPickupItem(org.bukkit.event.entity.EntityPickupItemEvent event)
      Updates a picked-up item if the entity is a player.
      Parameters:
      event - the entity item pickup event
    • onInventoryClick

      public void onInventoryClick(org.bukkit.event.inventory.InventoryClickEvent event)
      Updates all items in the player's bottom inventory when they click inside any inventory view.
      Parameters:
      event - the inventory click event
    • onInventoryOpen

      public void onInventoryOpen(org.bukkit.event.inventory.InventoryOpenEvent event)
      Updates all items in the player's bottom inventory when they open an inventory.
      Parameters:
      event - the inventory open event
    • onInventoryClose

      public void onInventoryClose(org.bukkit.event.inventory.InventoryCloseEvent event)
      Updates all items in the player's bottom inventory when they close an inventory.
      Parameters:
      event - the inventory close event
    • onPlayerJoin

      public void onPlayerJoin(org.bukkit.event.player.PlayerJoinEvent event)
      Updates all items in a player's inventory when they join the server.
      Parameters:
      event - the player join event