Class PlayerChangeBeaconEffectEvent
java.lang.Object
org.bukkit.event.Event
org.bukkit.event.player.PlayerEvent
io.papermc.paper.event.player.PlayerChangeBeaconEffectEvent
- All Implemented Interfaces:
Cancellable
Called when a player sets the effect for a beacon
- Since:
- 1.16.5
-
Nested Class Summary
Nested classes/interfaces inherited from class Event
Event.Result -
Field Summary
Fields inherited from class PlayerEvent
player -
Constructor Summary
ConstructorsConstructorDescriptionPlayerChangeBeaconEffectEvent(Player player, @Nullable PotionEffectType primary, @Nullable PotionEffectType secondary, Block beacon) -
Method Summary
Modifier and TypeMethodDescriptionstatic HandlerList@Nullable PotionEffectType@Nullable PotionEffectTypebooleanGets the cancellation state of this event.voidsetCancelled(boolean cancel) Sets the cancellation state of this event.voidsetConsumeItem(boolean consumeItem) Sets if the item used to change the beacon should be consumed.voidsetPrimary(@Nullable PotionEffectType primary) Sets the primary effectvoidsetSecondary(@Nullable PotionEffectType secondary) Sets the secondary effectbooleanGets if the item used to change the beacon will be consumed.Methods inherited from class PlayerEvent
getPlayerMethods inherited from class Event
callEvent, getEventName, isAsynchronous
-
Constructor Details
-
PlayerChangeBeaconEffectEvent
@Internal public PlayerChangeBeaconEffectEvent(Player player, @Nullable PotionEffectType primary, @Nullable PotionEffectType secondary, Block beacon)
-
-
Method Details
-
getPrimary
- Returns:
- the primary effect
- Since:
- 1.16.5
-
setPrimary
Sets the primary effectNOTE: The primary effect still has to be one of the valid effects for a beacon.
- Parameters:
primary- the primary effect- Since:
- 1.16.5
-
getSecondary
- Returns:
- the secondary effect
- Since:
- 1.16.5
-
setSecondary
Sets the secondary effectThis 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.
- Parameters:
secondary- the secondary effect- Since:
- 1.16.5
-
getBeacon
- Returns:
- the beacon block associated with this event
- Since:
- 1.16.5
-
willConsumeItem
public boolean willConsumeItem()Gets if the item used to change the beacon will be consumed.Independent of
isCancelled(). If the event is cancelled the item will NOT be consumed.- Returns:
trueif item will be consumed- Since:
- 1.16.5
-
setConsumeItem
public void setConsumeItem(boolean consumeItem) Sets if the item used to change the beacon should be consumed.Independent of
isCancelled(). If the event is cancelled the item will NOT be consumed.- Parameters:
consumeItem-trueif item should be consumed- Since:
- 1.16.5
-
isCancelled
public boolean isCancelled()Gets the cancellation state of this event. A cancelled event will not be executed in the server, but will still pass to other pluginsIf a
PlayerChangeBeaconEffectEventis cancelled, the changes will not take effect- Specified by:
isCancelledin interfaceCancellable- Returns:
trueif this event is cancelled- Since:
- 1.16.5
-
setCancelled
public void setCancelled(boolean cancel) Sets the cancellation state of this event. A cancelled event will not be executed in the server, but will still pass to other plugins.If cancelled, the item will NOT be consumed regardless of what
willConsumeItem()saysIf a
PlayerChangeBeaconEffectEventis cancelled, the changes will not be applied or saved.- Specified by:
setCancelledin interfaceCancellable- Parameters:
cancel-trueif you wish to cancel this event- Since:
- 1.16.5
-
getHandlers
- Specified by:
getHandlersin classEvent- Since:
- 1.16.5
-
getHandlerList
- Since:
- 1.16.5
-