Class PlayerUtilsItemGiveDropEvent

  • All Implemented Interfaces:
    org.bukkit.event.Cancellable

    
    public final class PlayerUtilsItemGiveDropEvent
    extends CancellableEvent
                        

    PlayerUtils 内 giveItem/giveItems 方法, 当玩家满背包导致物品需要掉落在地前触发. 擅自修改 event#getItemStack 方法获取到的物品实例将导致各种问题, 比如影响后续给予的所有物品.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
      public final static HandlerList handlers
      public final Player player
      public ItemStack itemStack
      public final static HandlerList handlers
      private boolean cancelled
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      HandlerList getHandlers()
      Player getPlayer() 获取物品接收者
      ItemStack getItemStack() 获取待掉落物品
      void setItemStack(@NonNull() ItemStack itemStack) 设置待掉落物品
      static HandlerList getHandlerList()
      • Methods inherited from class org.bukkit.event.Event

        getEventName, getHandlers, isAsynchronous
      • Methods inherited from class pers.neige.neigeitems.event.CancellableEvent

        call, isCancelled, setCancelled
      • Methods inherited from class org.bukkit.event.Cancellable

        isCancelled
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PlayerUtilsItemGiveDropEvent

        PlayerUtilsItemGiveDropEvent(Player player, ItemStack itemStack)
        Parameters:
        player - 物品接收者
        itemStack - 待掉落物品
    • Method Detail

      • getPlayer

        @NonNull() Player getPlayer()

        获取物品接收者

      • getItemStack

        @NonNull() ItemStack getItemStack()

        获取待掉落物品

      • setItemStack

         void setItemStack(@NonNull() ItemStack itemStack)

        设置待掉落物品

        Parameters:
        itemStack - 待掉落物品