We have a multiplayer world (as described, no realm), this is hosted by one person. If he now sends me the world save and I insert it and load it, I start as my character with his items, his armor and experience. Are there files that, if you edit them correctly, enable me to start with my items, armor and experience at my location where I have logged out. Of course, I could just put everything down and get my stuff out of the chest, but then I would still have the experience and when I die, almost everything is gone.
The problem is that the realm world is simply a normal Minecraft world which, in contrast to the worlds stored on devices, is located on the cloud. The rules that prevail are pretty much the same for the "world creator". If he has opened the world or started in the realm and transfers it to you, he automatically gives you the experience and the inventory. You can "fix" that, so to speak, even if not all of it. First of all, you and your friend, the hoster, pack all your things in the respective chest, your things in yours and he his things in his. This includes the entire inventory, as well as the items in the hotbar and also the armor. Unfortunately, the experience points can't be transferred, and animals that have been tamed by the host, such as dogs, cats or a parrot, remain "for the host". This means that these animals will listen to you, no longer your buddy. It's even worse with your animals. Although you use the same Microsoft account, the rules in Minecraft are slightly different. The animals only listen to you as a joined user, not as a host. That means the animals no longer have an owner. They won't jump over on your buddy. You are…
Practically useless.
Unfortunately there's no other way or no mod that can fix such an error. At least you can keep your inventory. But there's one more thing where you can get your XP and animals back. If not you, but another Acc is used as the host, you can rejoin as "Joined Player" and therefore have your XP and animals again. Because the Minecraft world creates files when new players enter this world and saves them forever. So the world will always save your progress, so your XP and your possessions in the form of pets. Unfortunately, with the host it is the case that die Welt only gives experience and control rights to those who have the world saved on their device.