Package io.papermc.paper.entity
Interface PlayerGiveResult
A result type used by
Player.give(ItemStack...)
and its overloads.-
Method Summary
Modifier and TypeMethodDescriptiondrops()
A collection of item entities dropped as a result of this call toPlayer.give(ItemStack...)
.A collection of itemstacks that were not added to the player's inventory as they did not fit.
-
Method Details
-
leftovers
@Unmodifiable Collection<ItemStack> 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
@Unmodifiable Collection<Item> drops()A collection of item entities dropped as a result of this call toPlayer.give(ItemStack...)
. The item entities contained here are not guaranteed to match theleftovers()
as plugins may cancel the spawning of item entities.- Returns:
- the unmodifiable collection of dropped item entities.
-