• Hey! Register here to create your account, engage with the community, and talk about what is new!

Pls help

PenawQ

New member
Joined
Apr 3, 2022
Messages
10
Reaction score
0
I am making a skyminer game and i wanna know how do i make it so when a player leaves the plot their items save. Currently when a player leaves it clears all of their items.
Does anyone know how to fix this?
 

JustSticky

Well-known member
Overlord
Joined
Mar 4, 2021
Messages
77
Reaction score
43
You need Noble rank to use the Player Action: Save Inventory and Player Action: Load Inventory code blocks.

But, there is a way to save a player's inventory without a rank. You have to use variables to save where each item is in the players inventory when they leave. Then, just load the inventory variable in the set inventory player action block.
 

Faultaph

New member
Joined
Sep 30, 2020
Messages
25
Reaction score
3
If you don't have Noble rank or above, you need to loop through the player's inventory and save it to a saved list whenever they leave. Then loop through it again and give the items to them when they join.
Alternatively, don't make a skyminer, since we have enough of them.
 

PenawQ

New member
Joined
Apr 3, 2022
Messages
10
Reaction score
0
You need Noble rank to use the Player Action: Save Inventory and Player Action: Load Inventory code blocks.

But, there is a way to save a player's inventory without a rank. You have to use variables to save where each item is in the players inventory when they leave. Then, just load the inventory variable in the set inventory player action block.
Sorry, but how exactly do i do this? Like which code do i use in the list manipulation tab?
 

ARMcPro

Forum adept
Overlord
Joined
Oct 20, 2020
Messages
1,226
Reaction score
347
Sorry, but how exactly do i do this? Like which code do i use in the list manipulation tab?
You don't need to, you just set a saved variable for each item game value thing (i will post photos of all of them) on leave, and set inventory and armor and offhand on join
1649436849586.png
1649436866338.png
1649436886772.png
 

ARMcPro

Forum adept
Overlord
Joined
Oct 20, 2020
Messages
1,226
Reaction score
347
Im not getting the items
Make sure the variables are SAVED type (you can do that by shift-right clicking with the variable)

Also, could you send the templates?
to get a template, shift-break the event and you should get an ender chest. Now hold the ender chest and type /i nbt (i think) and click on the message that appears, now go to https://dfonline.dev and import it then send the link here (do this for both of the join event and leave event)
 
Top Bottom