Code: Code: package me.Zicion.gm; import java.util.logging.Logger; import org.bukkit.GameMode; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import org.bukkit.plugin.java.JavaPlugin; public class Easygm extends JavaPlugin { public final Logger logger = Logger.getLogger("Minecraft"); public void onEnable() { getLogger().info("Easy GameMode enabled"); } public void onDisable() { getLogger().info("Easy GameMode disabled"); } public boolean onCommand(Command cmd, String commandLabel, CommandSender sender, String[] args) { Player player = (Player) sender; if(commandLabel.equals("gm1")) { player.setGameMode(GameMode.CREATIVE); return true; } else if(commandLabel.equals("gm0")) { player.setGameMode(GameMode.SURVIVAL); return true; } else if(commandLabel.equals("gm2")) { player.setGameMode(GameMode.ADVENTURE); return true; } return true; } } Plugin.yml Code: name: Easygm version: 1.4.1 main: me.Zicion.gm.Easygm commands: gm1: description: Sets gamemode to creative. gm0: description: Sets gamemode to survival. gm2: description: Sets gamemode to adventure. The server recognizes that it is a command but no effect is taken. The gamemode will not change.
Don't use commandLabel.. Use cmd.getName(); also, you should use equalsIgnoreCase(" "); You also unsafely cast Player.
bumppy5 in addition to the previous post: Don't use Logger.getLogger("Minecraft"), use the getLogger() method that you get by extending JavaPlugin. No need to print enable/disable messages, Bukkit does this for you.