Class AutoStoreItemEvent

java.lang.Object
net.okocraft.box.api.event.BoxEvent
net.okocraft.box.feature.autostore.event.AutoStoreItemEvent

@NotNullByDefault public final class AutoStoreItemEvent extends BoxEvent
A notification fired when AutoStore takes an item from a pickup or a drop. It is delivered on the thread handling the operation, after the item is removed from its source.
  • Constructor Details

    • AutoStoreItemEvent

      public AutoStoreItemEvent(StockActor.Player actor, Location location, ItemStack item, @Nullable @Nullable UUID sourceEntityId)
      Parameters:
      actor - the player associated with the item
      location - the original pickup or drop location
      item - the item AutoStore took
      sourceEntityId - the UUID of the item or arrow entity that was collected, or null if the item was taken from a drop list without an entity
  • Method Details

    • getActor

      public StockActor.Player getActor()
    • getLocation

      public Location getLocation()
      Returns a copy of the original pickup or drop location.
    • getItem

      public ItemStack getItem()
      Returns a copy of the item AutoStore took.
    • getSourceEntityId

      @Nullable public @Nullable UUID getSourceEntityId()
      Returns the UUID of the collected item or arrow entity, or null if there was no such entity.