Class LeadEvent

java.lang.Object
valorless.rarespawns.events.LeadEvent
All Implemented Interfaces:
org.bukkit.event.Listener

public class LeadEvent extends Object implements 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
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    Registers this listener with the server's plugin manager.
    void
    onEntityLeash(org.bukkit.event.entity.PlayerLeashEntityEvent event)
    Handles player attempts to leash entities.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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