Class PlayerInteractAtEntityListener

java.lang.Object
com.ranull.graves.listener.PlayerInteractAtEntityListener
All Implemented Interfaces:
org.bukkit.event.Listener

public class PlayerInteractAtEntityListener extends Object implements org.bukkit.event.Listener
Listener for handling PlayerInteractAtEntityEvent to interact with graves represented by ArmorStands.
  • Constructor Details

    • PlayerInteractAtEntityListener

      public PlayerInteractAtEntityListener(Graves plugin)
      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.