I am writing a mod that requires that a block be set as invisible on the client side.
My code currently has:
BlockPos pos = new BlockPos(x, y, z);
BlockState blockState = Minecraft.instance().level.getBlockState(pos);
Block block = blockState.getBlock();
but I cannot find a method to make the block invisible.
My event listener is:
@SubscribeEvent
public void onRenderWorld(RenderLevelStageEvent event)
I cannot use
Minecraft.instance().level.setBlock(block, Blocks.AIR.defaultProperties, 3);
as that did not work.
The block has to be visible to other players.