GameMode Inventories
Downloads
I'm too lazy to upload GMI files to Bukkit anymore, as builds are automatically created when the plugin is updated and changes pushed to GitHub.
For 1.18.x, please download GMI from the TARDIS Jenkins server: http://tardisjenkins.duckdns.org:8080/job/GameModeInventories/
Features
GameMode Inventories allows you to have separate inventories for Creative and Survival game modes (it also works for Adventure!).
- Inventories are saved and switched automatically
- Configurable option to save and restore inventories on player death
- Configurable option to also switch XP amount automatically (enabled by default)
- Configurable option to also switch armor automatically (enabled by default)
- Configurable option to also switch Ender Chest inventories automatically (enabled by default)
- Configurable option to restrict inventory opening for Chests, Ender Chests, Enchantment Tables, Anvils, Furnaces and Dispensers in CREATIVE game mode
- Configurable option to disable players dropping items from their inventories in CREATIVE game mode
- Configurable option to disable players from picking up items in CREATIVE game mode
- Configurable option to remove potion effects when switching from CREATIVE to SURVIVAL
- Configurable option turn off the plugin's messages which can get excessive when
no_pickups
andno_drops
are enabled - Configurable option to track the placement of CREATIVE gamemode placed blocks, then either: disable them from being broken, or, allow them to be broken but not drop anything - and also prevent pistons from moving them and deny the block dropping if the attached block is broken - this MUST be enabled for a world to work. You can specify a list of blocks you don't want to track as well
- Configurable option to prevents drops from falling blocks e.g. anvils, gravel, sand
- Configurable option to prevent the breaking of bedrock in CREATIVE, set to false to prevent breaks below Y<5 in all worlds, and Y>122 in the Nether
- Configurable blacklist of blocks that cannot be placed in CREATIVE (use Spigot Material names)
- Configurable blacklist of commands that cannot be used in CREATIVE
- Configurable option to preserve custom attributes when switching inventories (player and armour only)
- Configurable options to set which GMI features can be bypassed
- Configurable option to restrict spectator gamemode access
- Configurable option to switch to a creative world when changing to gamemode CREATIVE
- Localisable messages - edit messages.yml
- Support for using a MySQL database
Created in response to this plugin request: http:forums.bukkit.org/threads/separate-inventories-creative-survival.112187/
Featured in Curse's Minecraft Spotlights
How it works
Add the GameModeInventories.jar file to your server's plugins directory and start up the server. A config file will be created automatically with the default values.
Then all you have to do is switch game modes and your current inventory, armor and XP will be saved and your new game mode inventory will take its place.
What it doesn't do
GameMode Inventories is not a replacement for the Creative Control plugin:
- its primary purpose is an inventory management tool
- this is NOT likely to change anytime soon
- please stop asking
GameMode Inventories is an open sourced project, if you want to make the changes yourself, you are free to do so, as long as the plugin is released under the same license and conditions as GameMode Inventories.
Timings
Please do not bother posting timings for this plugin, here's why:
- See above
- I don't use any of the plugins' 'restriction' features
- You should expect to see GMI working hard if you have
track_creative_place
enabled, this is normal, after all, GMI is watching all your players all the time, and is keeping them all in line while not bothering you. Any server owner will eventually have a problem if he pushes his hardware too much, for example by running lots of heavyweight plugins. - If you do have a problem, the solutions are to either add more RAM/cpu power, re-prioritize your plugins to drop a few you don't desperately need, reduce your max players or seriously think about why you are letting your players have Creative gamemode at all (if you can't trust them not to abuse it, then don't let them have it, or set up a creative only world).
- Finally, don't expect SQLite to be able to handle big loads - if you are running this plugin on a server with
track_creative_place
enabled, you should probably be using MySQL as the GMI database provider
Commands/Configuration
There are several config options:
save_on_death: [true|false] xp: [true|false] armor: [true|false] enderchest: [true|false] remove_potions: [true|false] restrict_creative: [true|false] no_drops: [true|false] no_falling_drops: [true|false] no_pickups: [true|false] dont_spam_chat: [true|false] track_creative_place: enabled: [true|false] break_no_drop: [true|false] no_piston_move: [true|false] attached_block: [true|false] worlds: - world dont_track: - STONE - DIRT creative_blacklist: [true|false] blacklist: - TNT - BEDROCK - LAVA_BUCKET break_bedrock: [true|false] command_blacklist: [true|false] commands: - give - i - buy - sell custom_attributes: [true|false] bypass: inventories: [true|false] items: [true|false] blacklist: [true|false] survival: [true|false] commands: [true|false] restrict_spectator: [true|false]
You can enable/disable the options with a command (all options are available via tab completion):
/gmi save_on_death /gmi xp /gmi armor /gmi enderchest /gmi remove_potions /gmi restrict_creative /gmi restrict_spectator /gmi no_drops /gmi no_pickups /gmi dont_spam_chat /gmi track_creative_place /gmi break_no_drop /gmi attached_block /gmi break_bedrock /gmi creative_blacklist /gmi command_blacklist /gmi no_falling_drops /gmi custom_attributes /gmi bypass.inventories /gmi bypass.items /gmi bypass.blacklist /gmi bypass.survival /gmi bypass.commands
Permissions
There are four:
gamemodeinventories.use
Default: true - Allow players to have separate inventories for each game mode
gamemodeinventories.death
Default: op - Allow players to save their inventories on death, and restore them on respawn
gamemodeinventories.bypass
Default: op - Allow players to bypass inventory opening restrictions in CREATIVE (when restrict_creative: true
). Also allow players to bypass the no items drops / no item pickups restriction (when no_drops: true
or no_pickups: true
). As of version 2.5.4, you can configure which features can be bypassed:
inventories
- if true players can bypass not being able to open inventories in creativeitems
- if true players can bypass not being able to pick up and drop items in creativeblacklist
- if true players can bypass not being able to place and use restricted block and items in creativesurvival
- if true players can bypass being forced into survival gamemode when changing worldscommands
- if true players can bypass not being able to place and use restricted commands- If any of the bypass options are set to false, then nobody will be able to bypass them (regardless of whether they have the permission or not)
gamemodeinventories.admin
Default: op - Allow players to change config options
Source code
Dev builds
Development builds of this project can be acquired at the provided continuous integration server.
These builds have not been approved by the BukkitDev staff. Use them at your own risk.
@mgd9000
Temporary fix would be to set
track_creative_place: attached_block: false
as I think that's what's causing it.I may get a chance to look at it later, but I'm about to head off for a bike ride
@eccentricnz
Humm.. back to the drawingboard then =/
@eccentricnz
Hope you can fix that man.. I really do like this plugin.
@ThisUsernameIsMine
Fresh server and plugin install working as it should here...
@mgd9000
Place the pressure plate in survival, not creative?
@eccentricnz
Just thought you should know, doors are not opening with pressure plates. When i pulled your plugin, they work fine. Hope it's an easy fix for you. Love the plugin!!
@eccentricnz
Odd indeed, it's still happening :S
@ThisUsernameIsMine
That is odd, but fixed in GMI 2.7.2
Every command i run under 2.7.1 throws a NPE / Internal Server Error (default config):
The whole thing: http://dev.bukkit.org/paste/11443/
I'm running the latest version of Spigot:
This occurs under JRE 1.8 (1.8.0_31-b13) x64
@maxlehot1234
Looks like a misconfigured blacklist, do a pastebin of your config
HI, I see this error when I start the server, it is not normal...
http:pastebin.com/4qXzV6Ew
@MCCharlieCraft
You are confusing writing a record (which you can queue and do later), with reading a record and then acting on it (which needs to happen now). As far as logging the block placement GMI doesn't have a problem, but when it needs to read and determine an action for the block, that takes a lot more processing time and power. Which is why you only want to rollback logged changes when you have to...
GMI does not read from disk in any of the tracking events, so if you know of a way to process the requirements for the creative restrictions faster, then feel free to submit a pull request...
It is not normal to see this much CPU load caused by these events, even when listening to every player on the server.
You are seriously going to say that its is normal, even acceptable, for a single event to take 45ms to process, and an on piston extends event to take 250ms???? Those are major performance red flags.
Other plugins use these events and track way more than this plugin and leave next to no footprint on the server. That is why ppl are wondering why this one is sucking up all their server CPU while doing exactly the same things as LogBlock, McMMo, CoreProtect, and many other plugins that track literally every block place/break event. Some servers even run multiple plugins that check and log every single blockplace/break events. Yet this plugin is working 10 times as hard to the exact same things.
If you could get those timings down to an acceptable level, I would glady pay $25 - $50 for this plugin in the premium resources section of Spigots website, but in its current state it is just unusable on larger servers.
@baemboo
To be frank, I don't really care... here's why:
track_creative_place
enabled, this is normal, after all, GMI is watching all your players all the time, and is keeping them all in line while not bothering you. Any server owner will eventually have a problem if he pushes his hardware too much, for example by running lots of heavyweight plugins.track_creative_place
enabled, you should probably be using MySQL as the GMI database providerhttp://timings.aikar.co/?url=9825385
@therennon
No idea, set up some test servers
Seeking a plugin to store inventory and use them in a network (bungeecord).
This is the only "plugin" that apparently stored in "mysql" differentiating the creative way of survival mode.
Do you think that can work for this?
thx
@eccentricnz
Whether or not you were able to duplicate the problem, it is happening.
Doesn't matter anyway, this plugins on block break/place events in addition to the piston extends events lag the server so hard with more than 20 players online that I am just going to discontinue use.
It takes this plugin, on average, 250ms to resolve a single on piston extends event. The on player breaks block events take, on average, 45ms to resolve. That's almost an entire server tick per block break event. If more than 20 blocks are broken in a second this plugin will monopolize the tick loop.
Not recommended for servers with more than 15 players.
Who Ever is using Multiverse, Make sure to change game mode profiles to false! You can find this setting under multiverse inventorys in your plugins folder.. "use_game_mode_profiles: false"
@MCCharlieCraft
I set up a WG region with the game-mode flag set to SURVIVAL. Walking in and out of the region switches my inventory with no issues (so long as I am not opped - which bypasses the gamemode change)
Video:
Region config: