public class PrepareItemEnchantEvent extends InventoryEvent implements Cancellable
Event.Resulttransaction| Constructor and Description | 
|---|
PrepareItemEnchantEvent(@NotNull Player enchanter,
                       @NotNull InventoryView view,
                       @NotNull Block table,
                       @NotNull ItemStack item,
                       @NotNull EnchantmentOffer[] offers,
                       int bonus)  | 
| Modifier and Type | Method and Description | 
|---|---|
@NotNull Block | 
getEnchantBlock()
Gets the block being used to enchant the item 
 | 
@NotNull Player | 
getEnchanter()
Gets the player enchanting the item 
 | 
int | 
getEnchantmentBonus()
Get enchantment bonus in effect - corresponds to number of bookshelves 
 | 
@NotNull int[] | 
getExpLevelCostsOffered()
Deprecated. 
 
Use  
getOffers() instead of this method | 
static @NotNull HandlerList | 
getHandlerList()  | 
@NotNull HandlerList | 
getHandlers()  | 
@NotNull ItemStack | 
getItem()
Gets the item to be enchanted. 
 | 
@NotNull EnchantmentOffer[] | 
getOffers()
Get a list of available  
EnchantmentOffer for the player. | 
boolean | 
isCancelled()
Gets the cancellation state of this event. 
 | 
void | 
setCancelled(boolean cancel)
Sets the cancellation state of this event. 
 | 
getInventory, getView, getViewersgetEventName, isAsynchronouspublic PrepareItemEnchantEvent(@NotNull
                               @NotNull Player enchanter,
                               @NotNull
                               @NotNull InventoryView view,
                               @NotNull
                               @NotNull Block table,
                               @NotNull
                               @NotNull ItemStack item,
                               @NotNull
                               @NotNull EnchantmentOffer[] offers,
                               int bonus)
@NotNull public @NotNull Player getEnchanter()
@NotNull public @NotNull Block getEnchantBlock()
@NotNull public @NotNull ItemStack getItem()
@NotNull public @NotNull int[] getExpLevelCostsOffered()
getOffers() instead of this method@NotNull public @NotNull EnchantmentOffer[] getOffers()
EnchantmentOffer for the player. You can
 modify the values to change the available offers for the player. An offer
 may be null, if there isn't a enchantment offer at a specific slot. There
 are 3 slots in the enchantment table available to modify.public int getEnchantmentBonus()
public boolean isCancelled()
CancellableisCancelled in interface Cancellablepublic void setCancelled(boolean cancel)
CancellablesetCancelled in interface Cancellablecancel - true if you wish to cancel this event@NotNull public @NotNull HandlerList getHandlers()
getHandlers in class InventoryEvent@NotNull public static @NotNull HandlerList getHandlerList()
Copyright © 2021. All rights reserved.