Package valorless.rarespawns.events
Class LeadEvent
java.lang.Object
valorless.rarespawns.events.LeadEvent
- All Implemented Interfaces:
org.bukkit.event.Listener
Listener that restricts leashing of rare entities based on their configuration.
Cancels PlayerLeashEntityEvent for rare entities when their data marks them as not leadable. Includes an init() helper to register this listener.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidinit()Registers this listener with the server's plugin manager.voidonEntityLeash(org.bukkit.event.entity.PlayerLeashEntityEvent event) Handles player attempts to leash entities.
-
Constructor Details
-
LeadEvent
public LeadEvent()
-
-
Method Details
-
init
public static void init()Registers this listener with the server's plugin manager. -
onEntityLeash
public void onEntityLeash(org.bukkit.event.entity.PlayerLeashEntityEvent event) Handles player attempts to leash entities. If the target entity is a rare and its configuration sets leadable to false, the event is cancelled.- Parameters:
event- the player leash entity event
-