Class UseEntityEvent

java.lang.Object
org.bukkit.event.Event
com.sk89q.worldguard.bukkit.event.DelegateEvent
com.sk89q.worldguard.bukkit.event.entity.UseEntityEvent
All Implemented Interfaces:
Handleable, org.bukkit.event.Cancellable

public class UseEntityEvent extends DelegateEvent
This event is an internal event. We do not recommend handling or throwing this event or its subclasses as the interface is highly subject to change.

Thrown when an entity is used.

  • Constructor Details

    • UseEntityEvent

      public UseEntityEvent(@Nullable org.bukkit.event.Event originalEvent, Cause cause, org.bukkit.entity.Entity target)
  • Method Details

    • getEntity

      @Nonnull public org.bukkit.entity.Entity getEntity()
      Get the target entity being affected.
      Returns:
      a entity
    • getHandlers

      public org.bukkit.event.HandlerList getHandlers()
      Specified by:
      getHandlers in class org.bukkit.event.Event
    • getHandlerList

      public static org.bukkit.event.HandlerList getHandlerList()
    • getWorld

      public org.bukkit.World getWorld()
      Get the world.
      Returns:
      the world
    • getTarget

      public org.bukkit.Location getTarget()
      Get the target location being affected.
      Returns:
      a location
    • filter

      public boolean filter(com.google.common.base.Predicate<org.bukkit.Location> predicate, boolean cancelEventOnFalse)
      Filter the list of affected entities with the given predicate. If the predicate returns false, then the entity is not affected.
      Parameters:
      predicate - the predicate
      cancelEventOnFalse - true to cancel the event and clear the entity list once the predicate returns false
      Returns:
      true if one or more entities were filtered out