Cancellable
public class CreeperPowerEvent extends EntityEvent implements Cancellable
If a Creeper Power event is cancelled, the Creeper will not be powered.
Modifier and Type | Class | Description |
---|---|---|
static class |
CreeperPowerEvent.PowerCause |
An enum to specify the cause of the change in power
|
Event.Result
entity
Constructor | Description |
---|---|
CreeperPowerEvent(@NotNull Creeper creeper,
@NotNull LightningStrike bolt,
@NotNull CreeperPowerEvent.PowerCause cause) |
|
CreeperPowerEvent(@NotNull Creeper creeper,
@NotNull CreeperPowerEvent.PowerCause cause) |
Modifier and Type | Method | Description |
---|---|---|
@NotNull CreeperPowerEvent.PowerCause |
getCause() |
Gets the cause of the creeper being (un)powered.
|
@NotNull Creeper |
getEntity() |
Returns the Entity involved in this event
|
static @NotNull HandlerList |
getHandlerList() |
|
@NotNull HandlerList |
getHandlers() |
|
@Nullable LightningStrike |
getLightning() |
Gets the lightning bolt which is striking the Creeper.
|
boolean |
isCancelled() |
Gets the cancellation state of this event.
|
void |
setCancelled(boolean cancel) |
Sets the cancellation state of this event.
|
getEntityType
getEventName, isAsynchronous
public CreeperPowerEvent(@NotNull @NotNull Creeper creeper, @NotNull @NotNull LightningStrike bolt, @NotNull @NotNull CreeperPowerEvent.PowerCause cause)
public CreeperPowerEvent(@NotNull @NotNull Creeper creeper, @NotNull @NotNull CreeperPowerEvent.PowerCause cause)
public boolean isCancelled()
Cancellable
isCancelled
in interface Cancellable
public void setCancelled(boolean cancel)
Cancellable
setCancelled
in interface Cancellable
cancel
- true if you wish to cancel this event@NotNull public @NotNull Creeper getEntity()
EntityEvent
getEntity
in class EntityEvent
@Nullable public @Nullable LightningStrike getLightning()
@NotNull public @NotNull CreeperPowerEvent.PowerCause getCause()
@NotNull public @NotNull HandlerList getHandlers()
getHandlers
in class Event
@NotNull public static @NotNull HandlerList getHandlerList()
Copyright © 2020. All rights reserved.