Posted January 29, 20223 yr I'm new to forge developing and I'm trying to make a custom tile entity for a mod, but when I right click the block, the game crashes. The error seems tobe here: @Override public ActionResultType use(BlockState state, World worldIn, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) { if(worldIn.isClientSide()){ TileEntity tileEntity = worldIn.getBlockEntity(pos); if(!player.isCrouching()){ if(tileEntity instanceof BasicGemFusionBenchTile){ INamedContainerProvider containerProvider = createContainerProvider(worldIn,pos); NetworkHooks.openGui(((ServerPlayerEntity)player), containerProvider, tileEntity.getBlockPos()); }else { throw new IllegalStateException("Our Container provider is missing"); } } } return ActionResultType.SUCCESS; } Could someone help me out?
January 29, 20223 yr 6 minutes ago, RoggyMan01 said: if(worldIn.isClientSide()){ and then 6 minutes ago, RoggyMan01 said: NetworkHooks.openGui(((ServerPlayerEntity)player), containerProvider, tileEntity.getBlockPos()); the error should be clear, also note you can't open a gui (Container) on the client
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.