Ehh, I rather use in game tools to switch. TMI as is lets you change game modes with a push of a button, no having to exit minecraft, load an extra program, change map, save, reload minecraft, and do that each time you wish to switch back and forth.
I rather just push button, done. ;P
what if I liked to keep a vanilla minecraft.jar and didn't like to use in-game mods? and TMI doesn't let you switch to/from hardcore mode worlds. that reminds me: does this utility let you change to/from hardcore mode worlds? I can't find out from the OP.
EDIT: wow, I'm blind, I didn't notice the words "hardcore mode" in brackets for 1.9 PR changelog.
I'm voting up your post just because you put the code on github as opposed to expecting everyone to blindly trust you.
Having said that, you may want to actually edit the Readme and start tagging versions so people know if you've updated it to work with the latest version of Minecraft. Commenting your code may not be a bad thing either.
It's not working on my mac. i go there and click "creative", "Survival" or "Hardcore" and it says it worked, then I go into Minecraft and on the world description it says it's the gamemode I set it to, but whn I go into it, nothings changed