- Tested Minecraft Versions:
- Gnat008, Beatles, ljacqu, sgdc3
The way this plugin stores data is fundamentally different from MultiVerse-Inventories. Like MV-I, this plugin saves data in a .json format, but that is where the similarities end. Not only does this save your inventory, it saves your stats as well! This includes things like active potion effects, exp, level, economy balance, and more. These all can be configured on a per-item basis, should you not want all of these saved. See the Configuration section below for these. All commands can be seen ingame with the '/pwi help' command.
Thanks so much to @Koz4christ for making a video for PWI!
And also to @racerk12 for his video tutorial for PWI!
# PerWorldInventory configuration file #
# If true, the server will change player's gamemodes when entering a world
# The gamemode set is configured in the worlds.yml file
# If true, players will have different inventories for each gamemode
# If true, any worlds that are not in the worlds.yml configuration file will share the same inventory
# Choose whether or not to enable metrics sending.
# See https://bstats.org/getting-started for details.
# Send the number of configured groups.
# No group names will be sent!
# Send the total number of worlds on the server.
# All settings for players are here:
# Save and Load players' economy balances. Requires Vault!
# Load players' ender chests
# Load players' inventory
# All options for player stats are here:
# Load if a player is able to fly
# Load the player's display name
# Load a player's exhaustion level
# Load how much exp a player has
# Load a player's hunger level
# Load if a player is flying
# Load what gamemode a player is in. This is shadow-set to false if
# 'manage-gamemodes' is true, to stop infinite loop
# Load how much health a player has
# Load what level the player is
# Load all the potion effects of the player
# Load the saturation level of the player
# Load a player's fall distance
# Load the fire ticks a player has
# Load the maximum amount of air a player can have
# Load the current remaining air a player has
# Configure the amount of time between saves, in seconds
# Default is 5 minutes (300 seconds)
# Attempt to figure out which world a player last logged off in
# and save/load the correct data if that world is different.
# REQUIRES MC 1.9.2 OR NEWER
# Print out debug messages to the console for every event that happens in PWI
# Disables bypass regardless of permission
# Defaults to false
Pretty straightforward, turning the options to false will cause that item to not be loaded on world change. The option 'manage-gamemodes' is set to false by default to not interfere with other plugins that you may have to manage GameModes.
This is where you configure your world groups. Follow the default or above example to get the format. If you have 'manage-gamemodes' set to false in your main config, the 'default-gamemode' option here does nothing, and can be safely removed. Worlds in the same group will all share the same inventory and stats.
Once you have made your desired changes, simply type /pwi reload.
A default inventory loadout is provided for each configured group, as well as for a server fallback, if for some reason a world isn't in any group. These can be set ingame by using the '/pwi setworlddefault [group]' command, where group is a configured group name, or 'default'. If no group is specified, it will set the loadout for the group that you are currently standing in. This does not require a reload.
> Permissions and Commands
- perworldinventory.admin: Defaults to Ops, grants all other permissions
- perworldinventory.convert: Allows user to convert data from other plugins
- perworldinventory.reload: Allows user to reload configs and world groups
- perworldinventory.setdefaults: Allows user to set the default inventory loadout for a group
- perworldinventory.notify: Users with this permission will be notified if the config is out of date
- perworldinventory.bypass.*: Users that have this will keep their inventory when changing worlds or gamemode
- perworldinventory.bypass.gamemode: Users that have this will keep their inventory when changing gamemode
- perworldinventory.bypass.world: Users that have this will keep their inventory when changing worlds
- perworldinventory.bypass.enforcegamemode: Users with this permission will not have their gamemode changed if manage-gamemodes is enabled
/pwi help: Shows the help page
/pwi convert: Converts data from MultiVerse-Inventories; see below
/pwi reload: Reloads the config file and worlds file
/pwi setWorldDefault [default | <group_name>]: Sets the default inventory loadout for the specified group, or server default. If no parameter is given, it will sets the loadout for the group you are currently standing in.
If you are converting from MV-I, simply run the "/pwi convert multiverse" command and the plugin will take care of everything. You must have MV-I running for this. Keep in mind, converting only works with MV-I version 2.5, it will not work on 2.4. When MV-I is updated from 2.4 to 2.5, it switches from yml to json files, but does not convert the data until it is used. Be sure to keep your MV-I data around, just in case something does go wrong.
A converter from MultiInv is still in the works. There is a beginning framework as of version 1.4.0; do not use it! It is not fully operational yet, and will result in errors.
If you are a developer and want to use the API methods, you first must create a PerWorldInventoryAPI object. You can do that like this:
From there, just call what method you want from the API, for example:Code (Text):PerWorldInventory pwi = (PerWorldInventory) Bukkit.getServer().getPluginManager().getPlugin("PerWorldInventory");
PerWorldInventoryAPI api = pwi.getAPI();
You can view the full API class here.Code (Text):boolean canShare = api.canWorldsShare("world", "anotherWorld");
If you have an issue, please go here, or send me a private message here on Spigot.
For my own curiosity's sake, I decided to implement bStats. As always, nothing identifying anything or any server is sent. For more information, look here. This can be disabled in the config file.
The code repository can be found on Github.
Per World Inventory v1.11.5
Have a seperate inventory and more, for each world
[13:50:26 INFO]: vnvyvu lost connection: Disconnected
[13:50:26 ERROR]: **** THIS IS NOT AN ISSUE TO DO WITH PER WORLD PLUGINS ****
Could not pass event PlayerQuitEvent to PerWorldInventory v1.11.5
at us.Myles.PWP.TransparentListeners.PerWorldPluginLoader$1.execute(PerWorldPluginLoader.java:122) ~[?:?]
at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[spigot.jar:git-Spigot-6016ac7-10c10b3]
at us.Myles.PWP.TransparentListeners.PWPRegisteredListener.callEvent(PWPRegisteredListener.java:30) [PerWorldPlugins.jar:?]
at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:502) [spigot.jar:git-Spigot-6016ac7-10c10b3]
at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:487) [spigot.jar:git-Spigot-6016ac7-10c10b3]
at net.minecraft.server.v1_10_R1.PlayerList.disconnect(PlayerList.java:385) [spigot.jar:git-Spigot-6016ac7-10c10b3]
at net.minecraft.server.v1_10_R1.PlayerConnection.a(PlayerConnection.java:1058) [spigot.jar:git-Spigot-6016ac7-10c10b3]
at net.minecraft.server.v1_10_R1.NetworkManager.handleDisconnection(NetworkManager.java:318) [spigot.jar:git-Spigot-6016ac7-10c10b3]
at net.minecraft.server.v1_10_R1.ServerConnection.c(ServerConnection.java:174) [spigot.jar:git-Spigot-6016ac7-10c10b3]
at net.minecraft.server.v1_10_R1.MinecraftServer.D(MinecraftServer.java:832) [spigot.jar:git-Spigot-6016ac7-10c10b3]
at net.minecraft.server.v1_10_R1.DedicatedServer.D(DedicatedServer.java:399) [spigot.jar:git-Spigot-6016ac7-10c10b3]
at net.minecraft.server.v1_10_R1.MinecraftServer.C(MinecraftServer.java:672) [spigot.jar:git-Spigot-6016ac7-10c10b3]
at net.minecraft.server.v1_10_R1.MinecraftServer.run(MinecraftServer.java:571) [spigot.jar:git-Spigot-6016ac7-10c10b3]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_151]
Caused by: java.lang.NullPointerException
at me.gnat008.perworldinventory.data.players.PWIPlayerManager.savePlayer(PWIPlayerManager.java:200) ~[?:?]
at me.gnat008.perworldinventory.process.PlayerQuitProcess.processPlayerLeave(PlayerQuitProcess.java:46) ~[?:?]
at me.gnat008.perworldinventory.listeners.player.PlayerQuitListener.onPlayerQuit(PlayerQuitListener.java:42) ~[?:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_151]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_151]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_151]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_151]
at us.Myles.PWP.TransparentListeners.PerWorldPluginLoader$1.execute(PerWorldPluginLoader.java:120) ~[?:?]
... 13 more