Started by
kolokythi
on
Topic category: Help with Minecraft modding (Java Edition)
So i'm trying to copy a players inventory and then be able to paste it back in the same space with the same durability later how do I do this
(or if space is taken up with an item to have it be put in a random slot or dropped on the ground)
You could always create several global variables corresponding to the player's inventory slot.
For example:
Make a new global variable, name it whatever, set it to "itemstack" and "player persistent"
Then:
set up your procedure like this.
What this does here is it sets the global variable for the item slot to the item we selected.
For pasting:
this will set the item with the saved item using the variable.
There is likely a more efficient way, this is what came to mind first.
I hope this helps.
okay im gonna try this
i dont have access to the "set itemstack _ to: _ for entity _" block
i also cant put "event/target entity" in the "get copy of item from slot _ of _ if it has inventory"
Your global variable needs to be a "player persistent" variable for this to work.
Also I modified the blocks using data blocks, so look through everything until you can find what you need to recreate it.
I am willing to help more if you need it.