Jump to content

[1.14.3][ANSWERED] Transparent Block shows black


MrNoodles75

Recommended Posts

[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
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Please help. It was working perfectly fine last night when I was on, and now it's crashing?   report: https://pastebin.com/DjF1UUb8
    • Gfgvtbhhj   Hddhdhdhhddhd
    • Mam ten błąd również w GeckoLib Seven Days of Fingees i Fingees Dinozar I also have this error in GeckoLib Seven Days of Fingees and Fingees Dinozar
    • Whether you are a fan of Hypixel Bedwars, SkyWars and PvP gamemodes like that, well you would enjoy this server! We have a very fun and unique style of PvP that a lot of our players really enjoy and we want to bring this server to more players like you! Yes you reading this post haha. Introducing, the Minezone Network, home of SUPER CRAFT BLOCKS. We've been working on this server for over 4 years now. Here is what we have to offer: SUPER CRAFT BLOCKS: This has 3 different gamemodes you can play, Classic, Duels and Frenzy. Each mode offers over 60 kits to choose from, along with a total of over 60 maps, allowing for various different playstyles on each map. There are also random powerups that spawn on the map which can include Health Pots, Bazookas, Nukes, Extra Lives and way way more! There is also double jump in this gamemode as well, which makes PvP a lot more fun & unique. You only need a minimum of 2 players to start any mode! Classic: Choose a kit, 5 lives for each player, fight it out and claim the #1 spot! Look out for lightning as they can spawn powerups to really give you an advantage in the game! Duels: Fight against another random player or one of your friends and see who is the best! Frenzy: Your kit is randomly selected for you, each life you will have a different kit. You can fight with up to 100 players in this mode and lets see who will be the best out of that 100! All the other stuff from Classic/Duels apply to this mode as well like powerups. We have 2 ranks on this server too, VIP and CAPTAIN which has a bunch of different perks for SCB and other things like Cosmetics and more.   SERVER IP: If this server has caught your interest in any way, please consider joining and you will NOT regret it! Bring some of your friends online for an even better experience and join in on the fun at: IP: minezone.club Hope to see you online!   SERVER TRAILER: https://www.youtube.com/watch?v=0phpMgu1mH0
  • Topics

  • Who's Online (See full list)

×
×
  • Create New...

Important Information

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