Posted May 17, 20214 yr I'm trying to make a custom glass but I don't know how to make it transparent package fr.lithium.nirvana.Bases.Blocks; import net.minecraft.block.AbstractGlassBlock; public class GlassBase extends AbstractGlassBlock { public GlassBase(Properties p_i49999_1_) { super(p_i49999_1_); } } I guess I need to had an @OnlyIn(Dist.CLIENT) RenderType.State.Builder() bkrebojn ; but I don't know how it works and I didn't find any things about it in docs Where the block is Init: Spoiler package fr.lithium.nirvana.init; import fr.lithium.nirvana.Bases.Blocks.BlockBase; import fr.lithium.nirvana.Bases.Blocks.GlassBase; import fr.lithium.nirvana.NIRVANA; import fr.lithium.nirvana.utils.ModItemGroups; import net.minecraft.block.*; import net.minecraft.block.material.Material; import net.minecraft.item.Item; import net.minecraftforge.fml.RegistryObject; import net.minecraftforge.registries.DeferredRegister; import net.minecraftforge.registries.ForgeRegistries; public class ModBlocks { public static final DeferredRegister<Block> BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, NIRVANA.MODID); public static final RegistryObject<Block> BLOODY_GLASS = BlockBase.CreateBlock("bloody_glass", () -> new GlassBase(AbstractBlock.Properties.of(Material.GLASS).strength(0.3F).sound(SoundType.GLASS).noOcclusion()), new Item.Properties().tab(ModItemGroups.NIRVANA_TAB)); } And I also want to make it act like the Tconstructs clear glass Edited May 17, 20214 yr by Yourou1000
May 17, 20214 yr 1 hour ago, Yourou1000 said: @OnlyIn(Dist.CLIENT) RenderType.State.Builder() bkrebojn ; what is this supposed to do? if you want your block to be transparent, you have to add a RenderType to it in FMLClientSetupEvent
May 17, 20214 yr Author I thought that was the way to add a RenderType.... But it's obviously not. So do you have any examples ?
May 17, 20214 yr 20 minutes ago, Yourou1000 said: So do you have any examples ? use RenderTypeLookup#setRenderLayer in your FMLClientSetupEvent
May 17, 20214 yr Author If anybody need it: private void ClientSetUp(FMLClientSetupEvent e){ RenderTypeLookup.setRenderLayer(ModBlockInit.YOUR_BLOCK.get(), RenderType.translucent()); } and thx for your time and your help Luis ^^
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.