Class LoupeStartScanningEvent

java.lang.Object
org.bukkit.event.Event
org.bukkit.event.player.PlayerEvent
io.github.pylonmc.pylon.api.event.LoupeStartScanningEvent
All Implemented Interfaces:
org.bukkit.event.Cancellable

public class LoupeStartScanningEvent extends org.bukkit.event.player.PlayerEvent implements org.bukkit.event.Cancellable
Called when a Player attempts to start scanning something with the Loupe This event marks the start of a scan and LoupeCompleteScanningEvent marks the completion of a scan
If you'd like to add custom scanning functionality, use setCustomHandled(boolean) to handle the starting logic (e.g. filtering out anything that shouldn't be scanned, communicating why to players, etc) And use LoupeCompleteScanningEvent.setCustomHandled(boolean) to handle the scan completed logic (e.g. giving research points, etc)
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.bukkit.event.Event

    org.bukkit.event.Event.Result
  • Field Summary

    Fields inherited from class org.bukkit.event.player.PlayerEvent

    player
  • Constructor Summary

    Constructors
    Constructor
    Description
    LoupeStartScanningEvent(@NotNull org.bukkit.entity.Player player, @NotNull org.bukkit.util.RayTraceResult scanTarget)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static org.bukkit.event.HandlerList
     
    @NotNull org.bukkit.event.HandlerList
     
    org.bukkit.util.RayTraceResult
    The target of the Loupe's scan, guaranteed to have either a RayTraceResult.getHitBlock() or RayTraceResult.getHitEntity()
    boolean
     
    boolean
    If the scan logic is being handled by an outside plugin, such as to introduce scanning new objects or introducing special cases.
    void
    setCancelled(boolean cancelled)
     
    void
    setCustomHandled(boolean customHandled)
    If the scan logic is being handled by an outside plugin, such as to introduce scanning new objects or introducing special cases.

    Methods inherited from class org.bukkit.event.player.PlayerEvent

    getPlayer

    Methods inherited from class org.bukkit.event.Event

    callEvent, getEventName, isAsynchronous

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • LoupeStartScanningEvent

      public LoupeStartScanningEvent(@NotNull @NotNull org.bukkit.entity.Player player, @NotNull @NotNull org.bukkit.util.RayTraceResult scanTarget)
  • Method Details

    • getHandlers

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

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

      public org.bukkit.util.RayTraceResult getScanTarget()
      The target of the Loupe's scan, guaranteed to have either a RayTraceResult.getHitBlock() or RayTraceResult.getHitEntity()
    • isCustomHandled

      public boolean isCustomHandled()
      If the scan logic is being handled by an outside plugin, such as to introduce scanning new objects or introducing special cases.
      When implementing custom handling, the Loupe will only act as a tracker for beginning and completing scans and assuring the target remains the same throughout. No other logic such as player feedback, research point rewards, etc, is run, you must do that all yourself.
      If one plugin is already custom handling, it is recommended not to do it as well.
    • setCustomHandled

      public void setCustomHandled(boolean customHandled)
      If the scan logic is being handled by an outside plugin, such as to introduce scanning new objects or introducing special cases.
      When implementing custom handling, the Loupe will only act as a tracker for beginning and completing scans and assuring the target remains the same throughout. No other logic such as player feedback, research point rewards, etc, is run, you must do that all yourself.
      If one plugin is already custom handling, it is recommended not to do it as well.
    • isCancelled

      public boolean isCancelled()
      Specified by:
      isCancelled in interface org.bukkit.event.Cancellable
    • setCancelled

      public void setCancelled(boolean cancelled)
      Specified by:
      setCancelled in interface org.bukkit.event.Cancellable