Package io.papermc.paper.event.player
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
- 
Nested Class SummaryNested classes/interfaces inherited from class org.bukkit.event.EventEvent.Result
- 
Field SummaryFields inherited from class org.bukkit.event.player.PlayerEventplayer
- 
Constructor SummaryConstructorsConstructorDescriptionPlayerChangeBeaconEffectEvent(@NotNull Player player, @Nullable PotionEffectType primary, @Nullable PotionEffectType secondary, @Nullable Block beacon) 
- 
Method SummaryModifier and TypeMethodDescriptionstatic @NotNull HandlerListbooleanGets 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 consume.Methods inherited from class org.bukkit.event.player.PlayerEventgetPlayerMethods inherited from class org.bukkit.event.EventcallEvent, getEventName, isAsynchronous
- 
Constructor Details- 
PlayerChangeBeaconEffectEvent
 
- 
- 
Method Details- 
getPrimary- Returns:
- the primary effect
 
- 
setPrimarySets the primary effectNOTE: The primary effect still has to be one of the valid effects for a beacon. - Parameters:
- primary- the primary effect
 
- 
getSecondary- Returns:
- the secondary effect
 
- 
setSecondarySets 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
 
- 
getBeacon- Returns:
- the beacon block associated with this event, or null if not found
 
- 
willConsumeItempublic boolean willConsumeItem()Gets if the item used to change the beacon will be consume.Independant of isCancelled(). If the event is cancelled the item will NOT be consumed.- Returns:
- true if item will be consumed
 
- 
setConsumeItempublic void setConsumeItem(boolean consumeItem) Sets if the item used to change the beacon should be consumed.Independant of isCancelled(). If the event is cancelled the item will NOT be consumed.- Parameters:
- consumeItem- true if item should be consumed
 
- 
isCancelledpublic 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 interface- Cancellable
- Returns:
- true if this event is cancelled
 
- 
setCancelledpublic 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 pluginsIf 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 interface- Cancellable
- Parameters:
- cancel- true if you wish to cancel this event
 
- 
getHandlers- Specified by:
- getHandlersin class- Event
 
- 
getHandlerList
 
-