threader Posted February 17, 2021 Share Posted February 17, 2021 (edited) Hi! I'm creating a block that needs to be translucent, bc the model isn't a perfect cube. When I put it in the ground, the bottom become trasparent. I know it's a well knowed issue, but everything I could find told me to set its render layer with RenderTypeLookup#setRenderLayer (I also found topics which solved this problem overriding the Block#getRenderLayer(), but it doesnt exist anymore in this version) , so, I did it, but nothing changed and the bottom of the block still invisible, I tried getCutout(), getTranslucent() and a bunch of other methods but nothing worked (Yeah, the SetupClient#onClientSetupEvent is being called). Any ideas? (I'm sorry if there is any english grammar mistake or something like that) Here are the code and the block printscreen: package net.threader.generatorsmod; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.eventbus.api.IEventBus; import net.minecraftforge.fml.DistExecutor; import net.minecraftforge.fml.ModLoadingContext; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; import net.threader.generatorsmod.init.SetupClient; import net.threader.generatorsmod.init.SetupCommon; @Mod(GeneratorMod.MODID) public class GeneratorMod { public static final String MODID = "generators"; public static IEventBus MOD_EVENT_BUS; public GeneratorMod() { MOD_EVENT_BUS = FMLJavaModLoadingContext.get().getModEventBus(); MOD_EVENT_BUS.register(SetupCommon.class); DistExecutor.runWhenOn(Dist.CLIENT, () -> GeneratorMod::registerClientOnlyEvents); } public static void registerClientOnlyEvents() { MOD_EVENT_BUS.register(SetupClient.class); } } package net.threader.generatorsmod; import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.block.material.Material; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.IBlockReader; import net.threader.generatorsmod.init.SetupCommon; public class GeneratorBlock extends Block { public GeneratorBlock() { super(Block.Properties.create(Material.ROCK)); } @Override public boolean hasTileEntity(BlockState state) { return true; } @Override public TileEntity createTileEntity(BlockState state, IBlockReader world) { return SetupCommon.tileEntityType.create(); } } package net.threader.generatorsmod.init; import net.minecraft.block.GlassBlock; import net.minecraft.client.renderer.RenderType; import net.minecraft.client.renderer.RenderTypeLookup; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; public class SetupClient { @SubscribeEvent public static void onClientSetupEvent(FMLClientSetupEvent event) { RenderTypeLookup.setRenderLayer(SetupCommon.generatorBlock, RenderType.getCutout()); } } Edited February 17, 2021 by threader Quote Link to comment Share on other sites More sharing options...
Luis_ST Posted February 17, 2021 Share Posted February 17, 2021 you need to add notSolid to the block properties 1 Quote Link to comment Share on other sites More sharing options...
threader Posted February 17, 2021 Author Share Posted February 17, 2021 8 hours ago, Luis_ST said: you need to add notSolid to the block properties Worked, thanks! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.