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

[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 by MrNoodles75

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.

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

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.

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.

I tried using the methods for my Minecraft mod, but they don't seem to be working.

Edited by Mag

There, I got it

Untitled4.png

also used here

 

Untitled5.png

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

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.