Posted August 28, 201510 yr Hey there, im working on an electrizity network for my mod and now im struggling with connecting the blocks so they can pass over the energy to each other. what i did is i created a TileEntity_Electric and in there a field called connected. This is the TileEntity_Electric that should receive the energy. Now im trying to set this field with an item. In the item i have a public static TileEntity_Electric that i set like this in onItemRightClick (Called on both sites so i don't need packetHandling): @Override public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) { BlockPos pos = Minecraft.getMinecraft().objectMouseOver.getBlockPos(); if(world.getTileEntity(pos) instanceof TileEntity_Electric){ TileEntity_Electric toConnectTile = (TileEntity_Electric) world.getTileEntity(pos); if(lastTile!=null&&lastTile!=toConnectTile){ lastTile.connectTo(toConnectTile); lastTile=toConnectTile; } else{ player.addChatMessage(new ChatComponentText("Now in "+EnumChatFormatting.GREEN+"Connection Mode"+EnumChatFormatting.RESET+"To stop connecting, hold SHIFT+RIGHTCLICK! ")); lastTile = toConnectTile; } }else { if(world.getBlockState(pos).getBlock() instanceof BlockAir){ player.addChatMessage(new ChatComponentText("Stopped "+EnumChatFormatting.RED+"Connection Mode")); lastTile=null; } } return stack; } I have a GameOverlay in which i can see if a TileEntity_Electric is connected and the tileentity that it is connected with. But somehow - these connected tiles are sometimes tileentities that are have been in the world earlier and sometimes the block that i clicked the first time. What am i doing wrong? Do i have to use another method or put the field somewhere else - please help
August 28, 201510 yr Author I also tried having the lastTile variable in the Client/CommonProxy, but this had similar issues It would be really nice if somebody had a hint for me
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.