Package org.bukkit.event.block
Class BlockDispenseLootEvent
java.lang.Object
org.bukkit.event.Event
org.bukkit.event.block.BlockEvent
org.bukkit.event.block.BlockDispenseLootEvent
- All Implemented Interfaces:
Cancellable
Called when a block dispenses loot from its designated LootTable.
This is not to be confused with events like BlockDispenseEvent which fires when a
singular item is dispensed from its inventory container.
Example: A player unlocks a trial chamber vault and the vault block dispenses
its loot.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
Event.Result -
Field Summary
Fields inherited from class org.bukkit.event.block.BlockEvent
block -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the loot that will be dispensed.static @NotNull HandlerListGets the loot table used to generate the initial loot to dispense.Gets the player associated with this event.booleanGets the cancellation state of this event.voidsetCancelled(boolean cancel) Sets the cancellation state of this event.voidsetDispensedLoot(@Nullable List<ItemStack> dispensedLoot) Sets the loot that will be dispensed.Methods inherited from class org.bukkit.event.block.BlockEvent
getBlockMethods inherited from class org.bukkit.event.Event
callEvent, getEventName, isAsynchronous
-
Constructor Details
-
BlockDispenseLootEvent
-
-
Method Details
-
getDispensedLoot
Gets the loot that will be dispensed.- Returns:
- the loot that will be dispensed
-
setDispensedLoot
Sets the loot that will be dispensed.- Parameters:
dispensedLoot- new loot to dispense
-
getLootTable
Gets the loot table used to generate the initial loot to dispense.- Returns:
- the loot table used to generate the initial loot to dispense
-
getPlayer
Gets the player associated with this event.
Warning: Some event instances like aTrialSpawnerdispensing its reward loot may not have a player associated with them and will returnnull.- Returns:
- the player who unlocked the vault
-
isCancelled
public boolean isCancelled()Description copied from interface:CancellableGets the cancellation state of this event. A cancelled event will not be executed in the server, but will still pass to other plugins- Specified by:
isCancelledin interfaceCancellable- Returns:
trueif this event is cancelled
-
setCancelled
public void setCancelled(boolean cancel) Description copied from interface:CancellableSets the cancellation state of this event. A cancelled event will not be executed in the server, but will still pass to other plugins.- Specified by:
setCancelledin interfaceCancellable- Parameters:
cancel-trueif you wish to cancel this event
-
getHandlers
- Specified by:
getHandlersin classEvent
-
getHandlerList
-