Package valorless.rarespawns.events
Class ItemUpdateEvent
java.lang.Object
valorless.rarespawns.events.ItemUpdateEvent
- All Implemented Interfaces:
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 -
Method Summary
Modifier and TypeMethodDescriptionstatic voidinit()Registers this listener with the server's plugin manager.voidonEntityPickupItem(org.bukkit.event.entity.EntityPickupItemEvent event) Updates a picked-up item if the entity is a player.voidonInventoryClick(org.bukkit.event.inventory.InventoryClickEvent event) Updates all items in the player's bottom inventory when they click inside any inventory view.voidonInventoryClose(org.bukkit.event.inventory.InventoryCloseEvent event) Updates all items in the player's bottom inventory when they close an inventory.voidonInventoryOpen(org.bukkit.event.inventory.InventoryOpenEvent event) Updates all items in the player's bottom inventory when they open an inventory.voidonPlayerJoin(org.bukkit.event.player.PlayerJoinEvent event) Updates all items in a player's inventory when they join the server.
-
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
-