Skip to content

What is the difference between addStack, insertStack and setStack methods in the PlayerInventory class, and when are they called? #2834

Discussion options

You must be logged in to vote

addStack is an internal function, you shouldn't use that.
If you want to give the player some items, use insertStack. That will pick up the stack if there is space for the stack, like what /give does.
setStack replaces the selected stack with a new one. maybe replace a used tool with a broken one.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by TechPro424
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants