Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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 by Yourou1000

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

20 minutes ago, Yourou1000 said:

So do you have any examples ?

use RenderTypeLookup#setRenderLayer in your FMLClientSetupEvent

  • 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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.