Package com.ranull.graves.listener
Class PlayerTeleportListener
java.lang.Object
com.ranull.graves.listener.PlayerTeleportListener
- All Implemented Interfaces:
org.bukkit.event.Listener
Listens for PlayerTeleportEvent to handle interactions with grave blocks and
remove specific items from the player's inventory if they teleport into a grave location.
-
Constructor Summary
ConstructorsConstructorDescriptionPlayerTeleportListener
(Graves plugin) Constructs a new PlayerTeleportListener with the specified Graves plugin. -
Method Summary
Modifier and TypeMethodDescriptionvoid
onPlayerTeleport
(org.bukkit.event.player.PlayerTeleportEvent event) Handles PlayerTeleportEvent to manage interactions with grave blocks when a player teleports.
-
Constructor Details
-
PlayerTeleportListener
Constructs a new PlayerTeleportListener with the specified Graves plugin.- Parameters:
plugin
- The Graves plugin instance.
-
-
Method Details
-
onPlayerTeleport
public void onPlayerTeleport(org.bukkit.event.player.PlayerTeleportEvent event) Handles PlayerTeleportEvent to manage interactions with grave blocks when a player teleports. Checks if the player's new location is within a 15-block radius of any grave and removes specific compass items from their inventory if so.- Parameters:
event
- The PlayerTeleportEvent to handle.
-