What is the difference between addStack, insertStack and setStack methods in the PlayerInventory class, and when are they called? #2834
Answered
by
KosmX
TechPro424
asked this question in
Mod Dev Support
-
What is the difference between |
Beta Was this translation helpful? Give feedback.
Answered by
KosmX
Jan 7, 2023
Replies: 2 comments
-
|
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
TechPro424
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.