Jump to content

A mod tried to open a gui on the server without being a NetworkMod


Recommended Posts

So i'm trying to create a chest but i'm keep getting this error.

A mod tried to open a gui on the server without being a NetworkMod



Main file

	public void load(FMLInitializationEvent event) {
      ModLoader.registerContainerID(this, 30);	  
     Block crest = new crest(1999, Material.wood).setUnlocalizedName("Crest"); 
	GameRegistry.registerBlock(crest, "crest");
	LanguageRegistry.addName(crest, "Chest");		
	GameRegistry.addRecipe(new ItemStack(crest, 1), new Object [] {
		"012", "345", "678", 
		Character.valueOf('0'), new ItemStack(Block.stone, 1), 
		Character.valueOf('1'), new ItemStack(Block.stone, 1), 
		Character.valueOf('2'), new ItemStack(Block.stone, 1),
		Character.valueOf('3'), new ItemStack(Block.stone, 1), 
		Character.valueOf('4'), new ItemStack(Block.stone, 1), 
		Character.valueOf('5'), new ItemStack(Block.stone, 1), 
		Character.valueOf('6'), new ItemStack(Block.stone, 1), 
		Character.valueOf('7'), new ItemStack(Block.stone, 1), 
		Character.valueOf('8'), new ItemStack(Block.stone, 1)



public class Guicrest extends GuiContainer{

public Guicrest(InventoryPlayer inventory, int x, int y, int z) {
	super(new ContainerCrest());

protected void drawContainerForegroundLayer(int par1, int par2) {
	this.fontRenderer.drawString("Crest", 0, 0, 4210752);
	this.fontRenderer.drawString("Inventory", 0, 0, 4210752);

//declare your variables
private static final ResourceLocation field_110410_t = new ResourceLocation("compitem:textures/gui/container/generic_54.png");

protected void drawGuiContainerBackgroundLayer(float f, int i, int j) {
	GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);

	this.xSize = 212;
	this.ySize = 222;


block file

public void registerIcons(IconRegister par1IconRegister){
	 this.blockIcon = par1IconRegister.registerIcon("stone.texturePath");

public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int i, float a, float b, float c) {
		FMLNetworkHandler.openGui(player, new ContainerCrest(), 30, world, x, y, z);
		ModLoader.openGUI((EntityPlayerSP) player, new Guicrest(player.inventory, x, y, z));

	return true;

public TileEntity createNewTileEntity(World par1World) {
	return new TileEntitycrest();



I'm a beginner in coding and trying to learn how to create a mod. I have been coding now for a few days and this is just a error that i could not fix.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...

Important Information

By using this site, you agree to our Terms of Use.