Class VehicleDespawnEvent
java.lang.Object
org.bukkit.event.Event
nl.sbdeveloper.vehiclesplus.api.events.Event
nl.sbdeveloper.vehiclesplus.api.events.VehicleEvent<SpawnedVehicle>
nl.sbdeveloper.vehiclesplus.api.events.CancellableVehicleEvent<SpawnedVehicle>
nl.sbdeveloper.vehiclesplus.api.events.impl.VehicleDespawnEvent
- All Implemented Interfaces:
org.bukkit.event.Cancellable
This event gets fired when a
SpawnedVehicle
gets despawned.-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.bukkit.event.Event
org.bukkit.event.Event.Result
-
Constructor Summary
ConstructorsConstructorDescriptionVehicleDespawnEvent
(SpawnedVehicle vehicle, boolean force, org.bukkit.entity.Player despawner) Construct a newVehicleDespawnEvent
.VehicleDespawnEvent
(SpawnedVehicle vehicle, VehicleDespawnEvent.DespawnReason reason, boolean force) Construct a newVehicleDespawnEvent
. -
Method Summary
Modifier and TypeMethodDescriptionorg.bukkit.entity.Player
ThePlayer
that despawns the vehicle.The reason why the vehicle gets despawned.boolean
isForce()
Whether the vehicle is forced to despawn.void
setCancelled
(boolean cancelled) Set if this event gets cancelled.Methods inherited from class nl.sbdeveloper.vehiclesplus.api.events.CancellableVehicleEvent
isCancelled
Methods inherited from class nl.sbdeveloper.vehiclesplus.api.events.VehicleEvent
getVehicle
Methods inherited from class nl.sbdeveloper.vehiclesplus.api.events.Event
getHandlerList, getHandlers
Methods inherited from class org.bukkit.event.Event
getEventName, isAsynchronous
-
Constructor Details
-
VehicleDespawnEvent
public VehicleDespawnEvent(SpawnedVehicle vehicle, VehicleDespawnEvent.DespawnReason reason, boolean force) Construct a newVehicleDespawnEvent
.- Parameters:
vehicle
- TheSpawnedVehicle
that gets despawned.
-
VehicleDespawnEvent
public VehicleDespawnEvent(SpawnedVehicle vehicle, boolean force, @Nullable org.bukkit.entity.Player despawner) Construct a newVehicleDespawnEvent
.- Parameters:
vehicle
- TheSpawnedVehicle
that gets despawned.despawner
- ThePlayer
that despawns the vehicle.
-
-
Method Details
-
setCancelled
public void setCancelled(boolean cancelled) Description copied from class:CancellableVehicleEvent
Set if this event gets cancelled.- Specified by:
setCancelled
in interfaceorg.bukkit.event.Cancellable
- Overrides:
setCancelled
in classCancellableVehicleEvent<SpawnedVehicle>
- Parameters:
cancelled
- true if you wish to cancel this event
-
getReason
The reason why the vehicle gets despawned. -
isForce
public boolean isForce()Whether the vehicle is forced to despawn. -
getDespawner
@Nullable public org.bukkit.entity.Player getDespawner()ThePlayer
that despawns the vehicle.
-