[1.8.1] Adding a new gamemode
Page 1 of 1
[1.8.1] Adding a new gamemode
Decompiling minecraft.jar
Making a new gamemode
- Spoiler:
- 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
- Spoiler:
- make a new file called mod_gamemode.java or whatever you want to call the mod.
open it and type:- Code:
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")
{
mc.thePlayer.health = 20;
mc.thePlayer.fire = 0;
}
return true;
}
private Minecraft mc = ModLoader.getMinecraftInstance();
public String Version() { return GMAPI.GetVersion; }
}
Help
1. At mc.thePlayer.health = 20;, the number 20 means the half hearts.
2. ID's range from 4 to 99.
maciejkiller- Member
- Posts : 5
Join date : 2011-11-07
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum