MC Modding
Please register and join the community!
MC Modding
Would you like to react to this message? Create an account in a few clicks or log in to continue.

[1.8.1] Adding a new gamemode

Go down

[1.8.1] Adding a new gamemode Empty [1.8.1] Adding a new gamemode

Post by maciejkiller on Fri Nov 18, 2011 12:56 am

Decompiling minecraft.jar
Download ModLoader and GameMode API (get GameMode APIhere)
and download it as you normally would download ModLoader (drag and drop)
Run decompile.bat

Making a new gamemode
make a new file called or whatever you want to call the mod.
open it and type:
package net.minecraft.src;

import net.minecraft.client.Minecraft;

public class mod_gamemode extends BaseMod
    private int GamemodeID = 4;
        public mod_gamemode()
          GMAPI.AddGamemode(GamemodeID, "Namehere", new PlayerControllerSP(mc)); //Can be a custom PlayerController
      GMAPI.AddGamemodeLine1(GamemodeID,"New gamemode");
      GMAPI.AddGamemodeLine2(GamemodeID,"Epic thing here");
      ModLoader.SetInGameHook(this, true, false);
  public boolean OnTickInGame(Minecraft minecraft)

        if(minecraft == null)
            minecraft = ModLoader.getMinecraftInstance();
        if(minecraft.thePlayer == null || minecraft.theWorld == null)
            return false;
        if(GMAPI.CurrentPC == "Namehere")
   = 20;
   = 0;
        return true;
    private Minecraft mc = ModLoader.getMinecraftInstance();
        public String Version() { return GMAPI.GetVersion; }
Change all that says Namehere and the "New Gamemode" and "Epic thing here"

1. At = 20;, the number 20 means the half hearts.
2. ID's range from 4 to 99.


Posts : 5
Join date : 2011-11-07

Back to top Go down

Back to top

Permissions in this forum:
You cannot reply to topics in this forum