Class PlayerMoveListener

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

public class PlayerMoveListener extends Object implements org.bukkit.event.Listener
Listener for handling PlayerMoveEvent to manage interactions with graves and related mechanics.
  • Constructor Details

    • PlayerMoveListener

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

    • onPlayerMove

      public void onPlayerMove(org.bukkit.event.player.PlayerMoveEvent event)
      Handles the PlayerMoveEvent to manage interactions with graves and update player locations. This method checks if the player has moved and whether the new location is inside a border and safe. It then updates the player's last known solid location if applicable. Additionally, if the player is moving over a location that is known to contain a grave, and if the grave's configuration allows walking over it, the grave is automatically looted if the player is allowed to open it.
      Parameters:
      event - The PlayerMoveEvent to handle.