Package com.ranull.graves.listener
Class PlayerDropItemListener
java.lang.Object
com.ranull.graves.listener.PlayerDropItemListener
- All Implemented Interfaces:
org.bukkit.event.Listener
Listener for handling PlayerDropItemEvent to prevent dropping items associated with graves.
-
Constructor Summary
ConstructorsConstructorDescriptionPlayerDropItemListener
(Graves plugin) Constructs a PlayerDropItemListener with the specified Graves plugin. -
Method Summary
Modifier and TypeMethodDescriptionvoid
onPlayerDropItem
(org.bukkit.event.player.PlayerDropItemEvent event) Handles the PlayerDropItemEvent to prevent dropping items that are associated with graves.
-
Constructor Details
-
PlayerDropItemListener
Constructs a PlayerDropItemListener with the specified Graves plugin.- Parameters:
plugin
- The Graves plugin instance.
-
-
Method Details
-
onPlayerDropItem
public void onPlayerDropItem(org.bukkit.event.player.PlayerDropItemEvent event) Handles the PlayerDropItemEvent to prevent dropping items that are associated with graves. If the dropped item is linked to a grave (i.e., it has a grave UUID associated with it), the item drop is cancelled and the item entity is removed to avoid dupes or desyncs.- Parameters:
event
- The PlayerDropItemEvent to handle.
-