Easy way to convert JSON files to NBT?

Discussion in 'Spigot Plugin Help' started by liamcullins, Feb 19, 2020.

  1. So, I help a friend run a server, and I'm trying to move from the PerWorldInventory plugin to Multiverse Inventories, since PWI hasn't yet updated to 1.15. However, Multiverse Inventories doesn't allow you to import data from PWI, so I need to come up with a workaround. I found that MI stores main inventory files in the playerdata folder of said world, so if I could convert PWI's JSON files into NBT .dat files, I'd be golden.

    Has anyone found a way to do this? I've been Googling everything, and all I can find are links to GitHub along with discussions of techno-jargon that I don’t understand. I’m not a programmer by any stretch of the imagination.
     
  2. I think you'll find that's not entirely correct. It's Minecraft that stores inventories there. And that basically represents each player's current inventory. The inventory management plugins also have their own storage area to hold each player's inventory for the other world groups. Exactly how they do this varies from plugin to plugin. So you would need something to covert those other files.

    You'll have to do some testing, but I think you'll find that if you remove or replace PWI, players will keep whatever inventory they have in their current world, but lose everything else.

    When I switched from PWI (to xInventories), I simply bit the bullet and some players lost their inventories. I only have one survival and one creative world group on my server. People don't switch world groups too often, and losing a creative inventory is not big deal, so the only people who were affected were the survival players who had logged out from the creative world when I did the switch. Only a couple people complained.
     
  3. I was afraid that would be the only way forward. I’m in a similar situation with one survival and one creative world. The one silver lining is that I technically still have a record of their inventory and whatnot, so I can just give them their stuff back if need be. You’d think that converting JSON to NBT .dat files would be something the Minecraft community would’ve figured out a while ago.
     
  4. I don't think that would solve your problem.