public class PlayerChangeBeaconEffectEvent extends PlayerEvent implements Cancellable
Event.Resultplayer| Constructor and Description |
|---|
PlayerChangeBeaconEffectEvent(@NotNull Player player,
@Nullable PotionEffectType primary,
@Nullable PotionEffectType secondary,
@Nullable Block beacon) |
| Modifier and Type | Method and Description |
|---|---|
@Nullable Block |
getBeacon() |
static @NotNull HandlerList |
getHandlerList() |
@NotNull HandlerList |
getHandlers() |
@Nullable PotionEffectType |
getPrimary() |
@Nullable PotionEffectType |
getSecondary() |
boolean |
isCancelled()
Gets the cancellation state of this event.
|
void |
setCancelled(boolean cancel)
Sets the cancellation state of this event.
|
void |
setConsumeItem(boolean consumeItem)
Sets if the item used to change the beacon should be consumed.
|
void |
setPrimary(@Nullable PotionEffectType primary)
Sets the primary effect
|
void |
setSecondary(@Nullable PotionEffectType secondary)
Sets the secondary effect
|
boolean |
willConsumeItem()
Gets if the item used to change the beacon will be consume.
|
getPlayercallEvent, getEventName, isAsynchronous@Nullable public @Nullable PotionEffectType getPrimary()
public void setPrimary(@Nullable @Nullable PotionEffectType primary)
NOTE: The primary effect still has to be one of the valid effects for a beacon.
primary - the primary effect@Nullable public @Nullable PotionEffectType getSecondary()
public void setSecondary(@Nullable @Nullable PotionEffectType secondary)
This only has an effect when the beacon is able to accept a secondary effect. NOTE: The secondary effect still has to be a valid effect for a beacon.
secondary - the secondary effect@Nullable public @Nullable Block getBeacon()
public boolean willConsumeItem()
Independant of isCancelled(). If the event is cancelled
the item will NOT be consumed.
public void setConsumeItem(boolean consumeItem)
Independant of isCancelled(). If the event is cancelled
the item will NOT be consumed.
consumeItem - true if item should be consumedpublic boolean isCancelled()
If a PlayerChangeBeaconEffectEvent is cancelled, the changes will
not take effect
isCancelled in interface Cancellablepublic void setCancelled(boolean cancel)
If cancelled, the item will NOT be consumed regardless of what willConsumeItem() says
If a PlayerChangeBeaconEffectEvent is cancelled, the changes will not be applied
or saved.
setCancelled in interface Cancellablecancel - true if you wish to cancel this event@NotNull public @NotNull HandlerList getHandlers()
getHandlers in class Event@NotNull public static @NotNull HandlerList getHandlerList()
Copyright © 2021. All rights reserved.