Class ItemDropEvent

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

    
    public final class ItemDropEvent
    extends CancellableEvent
                        

    物品掉落事件, /ni drop指令触发.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Constructor Summary

      Constructors 
      Constructor Description
      ItemDropEvent(String id, ItemStack itemStack, Location location) amount 取默认值 itemStack.
      ItemDropEvent(String id, ItemStack itemStack, int amount, Location location) parser 取默认值 null
      ItemDropEvent(String id, ItemStack itemStack, int amount, Location location, OfflinePlayer parser)
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      HandlerList getHandlers()
      String getId() 获取物品ID
      OfflinePlayer getParser() 获取物品解析对象
      ItemStack getItemStack() 获取待掉落物品
      void setItemStack(@NonNull() ItemStack itemStack) 设置待掉落物品
      int getAmount() 获取掉落数量
      void setAmount(int amount) 设置掉落数量
      Location getLocation() 获取掉落位置
      void setLocation(@NonNull() Location location) 设置掉落位置
      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

      • ItemDropEvent

        ItemDropEvent(String id, ItemStack itemStack, Location location)
        amount 取默认值 itemStack.
        Parameters:
        id - 物品ID
        itemStack - 待掉落物品
        location - 掉落位置
      • ItemDropEvent

        ItemDropEvent(String id, ItemStack itemStack, int amount, Location location)
        parser 取默认值 null
        Parameters:
        id - 物品ID
        itemStack - 待掉落物品
        amount - 掉落数量
        location - 掉落位置
      • ItemDropEvent

        ItemDropEvent(String id, ItemStack itemStack, int amount, Location location, OfflinePlayer parser)
        Parameters:
        id - 物品ID
        itemStack - 待掉落物品
        amount - 掉落数量
        location - 掉落位置
        parser - 物品解析对象
    • Method Detail

      • getParser

        @Nullable() OfflinePlayer getParser()

        获取物品解析对象

      • getItemStack

        @NonNull() ItemStack getItemStack()

        获取待掉落物品

      • setItemStack

         void setItemStack(@NonNull() ItemStack itemStack)

        设置待掉落物品

        Parameters:
        itemStack - 待掉落物品
      • getAmount

         int getAmount()

        获取掉落数量

      • setAmount

         void setAmount(int amount)

        设置掉落数量

        Parameters:
        amount - 掉落数量
      • getLocation

        @NonNull() Location getLocation()

        获取掉落位置

      • setLocation

         void setLocation(@NonNull() Location location)

        设置掉落位置

        Parameters:
        location - 掉落位置