Class PlayerVehicleStorageAccessEvent

All Implemented Interfaces:
Cancellable

public final class PlayerVehicleStorageAccessEvent extends PlayerVehicleEvent implements Cancellable
Called when a player accesses a storage which is attached to a vehicle (e.g the storage of a boat).
See Also:
  • Method Details

    • getVehicle

      public Vehicle getVehicle()
      Gets the vehicle the storage is attached to. Note that the vehicle might be null, e.g if the related vehicle could not be found.
      Overrides:
      getVehicle in class PlayerVehicleEvent
      Returns:
      the vehicle (or null if the related vehicle no longer exists).
    • getStorageID

      public long getStorageID()
      Gets the storage ID of the vehicle storage.
      Returns:
      the global storage ID.
    • getStorage

      public Storage getStorage()
      Gets the related storage object.
      Returns:
      the storage object (representing the vehicle storage).
    • isCancelled

      public boolean isCancelled()
      /////////////////////////////////////////////////////////////////////////
      Specified by:
      isCancelled in interface Cancellable
      Returns:
      true if the event is cancelled, or false if not.
    • setCancelled

      public void setCancelled(boolean cancel)
      Description copied from interface: Cancellable
      Cancels this event. This means it will no longer be executed, but other plugins will still receive the event.

      Specified by:
      setCancelled in interface Cancellable
      Parameters:
      cancel - set to true if you want to cancel this event.