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.

[1.18] [SOLVED] Custom block with transparent parts makes block behind invisible

Featured Replies

Posted

Hey, I'm fairly new to the modding community and I'm coding a Mod that includes Vertical Slabs for 1.18.

Coding the Slabs I pretty much took the way Stairs are made and just removed the bottom extended part.

I wanted to take the Original Minecraft textures and after hours of getting the ColorMaps and Tinting to work I realized, that Blocks behind the full Block Side are not rendered. I read something about "culling" but I didn't quite understand.

It looks like this:

unknown.png

 

unknown.png

 

unknown.png

I suspect that the problem is not in my .json Files but in my custom class "ConnectableWallBlock" because it doesn't really matter, even if I take the original oak leaves json it doesn't work. I also tried taking the getVisualShape (like in the AbstractGlassBlock class) and making it return shapes.empty but that didn't work either.

I have .noOcclusion() in my Constructor Chain and in my ClientSetup I also call RenderType cutout.
At the moment I have no clue what else I could try to make it work.

GitHub:

https://github.com/Brainterminator/utilityblocks (look at the MoreWallBlocks Branch)

I hope you guys have some ideas!

Edited by Brainterminator

  • Author
4 hours ago, diesieben07 said:

Created your own thread for you. Please post your code, ideally a Git repo.

Thank you so much!

Edited by Brainterminator

I suggest you create a new ConnectableWallBlock that extends LeavesBlock, setting the PERSISTENT state property to true (because I imagine your walls don't need to decay). This way most of the leaf property you would expect from a block made of leaves should be already included and you also take advantage of Minecraft automatically setting the render layer to cutoutMipped or solid depending on the user graphic settings.

Maybe won't solve your problem but it's sure a step forward.

  • Author
2 hours ago, X-Lomir said:

I suggest you create a new ConnectableWallBlock that extends LeavesBlock, setting the PERSISTENT state property to true (because I imagine your walls don't need to decay). This way most of the leaf property you would expect from a block made of leaves should be already included and you also take advantage of Minecraft automatically setting the render layer to cutoutMipped or solid depending on the user graphic settings.

Maybe won't solve your problem but it's sure a step forward.

That actually fixed it! Now my LeafWalls have correct transparency! And the fact that they also adapt according to the graphics settings is also nice!
Thanks so much!

Edited by Brainterminator

  • Brainterminator changed the title to [1.18] [SOLVED] Custom block with transparent parts makes block behind invisible

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.