MyWorlds/SeperateInventories

From BergerHealer Wiki
Revision as of 14:40, 13 September 2020 by Bergerhealer Wiki>RyanDo
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

« Go back

Configuration

MyWorlds has an advanced system in place to separate player data on different 'island' groups of worlds. This way you can prevent items going between worlds, while allowing them between linked worlds in survival. Player data is saved inside the world folder, in standard Minecraft NBT format. No special database is used.

To begin using this system, set useWorldInventories to true in plugins/My_Worlds/config.yml.

The moment it is turned on, all worlds will have their own inventory state. This includes the player's items, experience, potion effects, health, hunger. Normally all player data is stored on the main world ('world'). Now this is no longer the case, it means players on other worlds will see their inventory wiped. Their items are still there, but only on the main world. You'll have to arrange inventory migration if you have existing players.

Commands

The main command to manage world inventory configuration is the /world inventory command. Syntax is as follows:

/world inventory merge [world1] [world2] [world3]

/world inventory split [world1] [world2] [world3]

/world inventory enable [world]

/world inventory disable [world]

When merging inventories, all their state is shared. The data of this shared state is saved in the first world argument of your merge command, in the example 'world1'. If players have existing data on a particular world you want to keep, make sure to use this world name as a first argument.

When splitting, world name order doesn't matter. Each world you specify is detached from any shared state, and given its own inventory for that world alone. To migrate a world, you can first split it from the original shared world group, then use merge to connect it to the other group.

No player data will ever be lost as a result of splitting/merging. If you accidentally 'lose' people's data by setting the main world for an inventory group, you can either copy the worldname/playerdata folder to the right place, or use the split command for that world to allow players to (temporarily) access their old inventories again.

With enable/disable, inventory saving for that world can be turned off entirely. When players rejoin the world, their inventory will be completely wiped every time.

Permissions

There are several permissions which configure inventory behavior: myworlds.world.inventory - Whether the inventory merge/split/etc. commands can be used myworlds.world.keepinventory - Makes player exempt from splitting inventories, always keeping the inventory when switching between worlds.