Skip to content

Instantly share code, notes, and snippets.

@Alpvax
Created July 7, 2015 12:27
Show Gist options
  • Save Alpvax/5ca7361968978b72dd9c to your computer and use it in GitHub Desktop.
Save Alpvax/5ca7361968978b72dd9c to your computer and use it in GitHub Desktop.
Open GUI on login
@SideOnly(Side.CLIENT)
public class OpenGuiTask implements Runnable {
private String modId;
private int guiId;
public OpenGuiTask(String modId, int guiId) {
this.modId = modId;
this.guiId = guiId;
}
@Override
public void run() {
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
player.openGui(modId, guiId, player.worldObj, (int)player.posX, (int)player.posY, (int)player.posZ);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment