Posted August 28, 20196 yr [ANSWERED] How do I make my Blocks have an Opacity like Glass I tried going to another question but I couldn't find my answer I tried using isOpaqueCube from Block.java but It throughs an error because it is final @Override public final boolean isOpaqueCube(BlockState state, IBlockReader worldIn, BlockPos pos) { return false; } I do not know how to do this can someone please help. here is my code: Spoiler import net.minecraft.block.Block; import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; import net.minecraftforge.common.ToolType; public class Plexiglass extends Block { public Plexiglass() { super(Properties.create(Material.GLASS) .sound(SoundType.METAL) .hardnessAndResistance(5.0f) .lightValue(14) .harvestTool(ToolType.PICKAXE) .variableOpacity() ); setRegistryName("plexiglass"); } } Edited August 29, 20196 yr by MrNoodles75
August 28, 20196 yr For a similar effect in my mod (translucent crystal), I override isOpaqueCube and getBlockLayer in my block class. @Override public boolean isOpaqueCube(IBlockState state) { return false; } @SideOnly(Side.CLIENT) public BlockRenderLayer getBlockLayer() { return BlockRenderLayer.TRANSLUCENT; } Fancy 3D Graphing Calculator mod, with many different coordinate systems. Lightweight 3D/2D position/vector transformations library, also with support for different coordinate systems.
August 28, 20196 yr Author @SerpentDagger 0 Advanced issues found ▲ 4 minutes ago, SerpentDagger said: For a similar effect in my mod (translucent crystal), I override isOpaqueCube and getBlockLayer in my block class. @Override public boolean isOpaqueCube(IBlockState state) { return false; } @SideOnly(Side.CLIENT) public BlockRenderLayer getBlockLayer() { return BlockRenderLayer.TRANSLUCENT; } I'm pretty sure this is for 1.12 correct?
August 28, 20196 yr 2 minutes ago, MrNoodles75 said: I'm pretty sure this is for 1.12 correct? That's correct, I'm using 1.12.2. I didn't think those methods would have changed between versions, but it's possible that they did. If so, I'm sorry about the confusion. You may still need to override the two of them, but if it's significantly different in 1.14, then you should take my advice with a grain of salt. Fancy 3D Graphing Calculator mod, with many different coordinate systems. Lightweight 3D/2D position/vector transformations library, also with support for different coordinate systems.
August 28, 20196 yr 38 minutes ago, SerpentDagger said: public BlockRenderLayer getBlockLayer() 33 minutes ago, MrNoodles75 said: I'm pretty sure this is for 1.12 correct? It's called getRenderLayer now, and it is the only thing you have to override. VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
September 1, 20196 yr I tried using the methods for my Minecraft mod, but they don't seem to be working. Edited September 1, 20196 yr by Mag
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.