Interface PlayerGiveResult


@NullMarked public interface PlayerGiveResult
A result type used by Player.give(ItemStack...) and its overloads.
  • Method Details

    • leftovers

      A collection of itemstacks that were not added to the player's inventory as they did not fit. The collection is derived from the collections of items to add by creating copies of each stack that was not fully added to the inventory and assigning the non-added count as their amount.

      Itemstacks found here *may* also be found as item entities in the drops() collection, as the give logic may have dropped them.

      Returns:
      the unmodifiable collection of itemstacks that are leftover as they could not be added. Each element is a copy of the input stack they are derived from.
    • drops

      A collection of item entities dropped as a result of this call to Player.give(ItemStack...). The item entities contained here are not guaranteed to match the leftovers() as plugins may cancel the spawning of item entities.
      Returns:
      the unmodifiable collection of dropped item entities.