Save your inventory and give it to another player

Started by Shmee1501655 on

Topic category: Troubleshooting, bugs, and solutions

Last seen on 15:18, 21. Oct 2023
Joined Oct 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Save your inventory and give it to another player

Hi, I am trying to make a procedure that swaps your inventory with another player's inventory. I don't know how to save a player's inventory and give it to another player. I need it to store the durability of items and the number of items. I tried having a different variable for every slot in the inventory but it didn't work. Here is my code for saving inventory:

https://drive.google.com/file/d/1ZmhFVnHmvIaW_3ImAiLMQAeLSSr6DPuL/view?usp=sharing

Here is my code for giving your inventory to another player:

https://drive.google.com/file/d/1Vsbf3E5c1WvnArxZX03ZVrO8V5GKoVKe/view?usp=sharing

 

 

 

Last seen on 22:27, 12. Feb 2024
Joined Nov 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Use 2 item varibles. Save…
Thu, 10/14/2021 - 16:42

Use 2 item varibles.
Save item from slot x of p1 to first varible and item from slot x of px to second and then set item in slot x of p1 to second varible and item in slot x of p2 to first varible and that's how you make item swap.

Make sure to use third varible for x.

I hope this will help you. :)

Last seen on 15:18, 21. Oct 2023
Joined Oct 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Do I have to create…
Thu, 10/14/2021 - 19:43

Do I have to create variables for every slot in your inventory? I also want it to be able to save every item in a player's inventory and when a player dies, give it back. I need it to work on my server but keep inventory has to be off because my server has mini games and survival mode and keep inventory has to be off for mini games but for survival mode it needs to save items.