Look what getGameMode returns in the javadocs. Answer: a GameMode enum. Therefore we have to check getGameMode against GameMode.CREATIVE
I think its if (player.getGameMode() == GameMode.CREATIVE) { //Do Something } But thats off the top of my head.
Ahh, I thought you were accusing me of copying your post, to which I was D: and has screenshot ready to show I didnt. @rolfcopter399 Basically to get a list of possible GameMode.* on eclipse if you type GameMode. It will list the possible ones such as MATERIAL. and other ones :3