Class PlayerInteractEntityListener

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

public class PlayerInteractEntityListener extends Object implements org.bukkit.event.Listener
Listener for handling PlayerInteractEntityEvent to interact with ItemFrame entities representing graves.
  • Constructor Details

    • PlayerInteractEntityListener

      public PlayerInteractEntityListener(Graves plugin)
      Constructs a PlayerInteractEntityListener with the specified Graves plugin.
      Parameters:
      plugin - The Graves plugin instance.
  • Method Details

    • onPlayerInteractEntity

      public void onPlayerInteractEntity(org.bukkit.event.player.PlayerInteractEntityEvent event)
      Handles the PlayerInteractEntityEvent when a player interacts with an ItemFrame entity. If the interacted entity is an ItemFrame 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 PlayerInteractEntityEvent to handle.