Package com.ranull.graves.listener
Class PlayerInteractAtEntityListener
java.lang.Object
com.ranull.graves.listener.PlayerInteractAtEntityListener
- All Implemented Interfaces:
org.bukkit.event.Listener
Listener for handling PlayerInteractAtEntityEvent to interact with graves represented by ArmorStands.
-
Constructor Summary
ConstructorsConstructorDescriptionPlayerInteractAtEntityListener
(Graves plugin) Constructs a PlayerInteractAtEntityListener with the specified Graves plugin. -
Method Summary
Modifier and TypeMethodDescriptionvoid
onPlayerInteractAtEntity
(org.bukkit.event.player.PlayerInteractAtEntityEvent event) Handles the PlayerInteractAtEntityEvent when a player interacts with an ArmorStand entity.
-
Constructor Details
-
PlayerInteractAtEntityListener
Constructs a PlayerInteractAtEntityListener with the specified Graves plugin.- Parameters:
plugin
- The Graves plugin instance.
-
-
Method Details
-
onPlayerInteractAtEntity
public void onPlayerInteractAtEntity(org.bukkit.event.player.PlayerInteractAtEntityEvent event) Handles the PlayerInteractAtEntityEvent when a player interacts with an ArmorStand entity. If the interacted entity is an ArmorStand and represents a grave, the interaction will either open the grave or cancel the event based on the grave's state and the player's actions. The event is only processed if: - The hand used for the interaction is the main hand (or the server version does not support offhand). - The player is not in Spectator mode (except on very old versions that lack Spectator).- Parameters:
event
- The PlayerInteractAtEntityEvent to handle.
-