My friend loses all his items upon disconnect

Solution 1:

I see to possibilities that could cause that:

  1. Your server switches between online and offline IDs
  2. for some reason, your server does not write the player save files correctly

Check your server-log for the messages when your friend connects, you should see a message telling you the player-id of your friend.

Check your server-worlds directory, if you find files with that player-ID in your world save below the following folders.

  • playerdata/
  • stats/
  • advancements/

in each of the folders you should find a file with the player-id of your friend. Check if the "last modified" time changes, after your friend plays on your server.

If not you could try to run the /save-all command on your server before you close the server.

if the files still are not saved, check if your server has write permissions on this files, and if there is a "readonly" flag on the files.