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.12.2][SOLVED]texture opacity in a custom block model json not supported?

Featured Replies

Posted

Hello,

Im working on a block with fluids inside it,

I made a model for it with glass so you can see what fluid is inside it, this is how it looks in the world and in my hand:

Spoiler

5a44c64c3a4e4_Knipsel(2).PNG.b4e805acfc7243960e5fb5a9017b349e.PNGKnipsel.PNG.2ce9c31fdeccf33edc716d9b611aa53d.PNG

as you can see it works when i hold it

My code for the model file

{
    "textures": {
        "0": "eaglesess:machines/factory_table_side",
        "1": "eaglesess:machines/liquid_absorber_side",
        "2": "eaglesess:machines/wooden_casing",
        "3": "eaglesess:machines/liquid_absorber_top",
        "4": "eaglesess:machines/liquid_absorber_liquid"
    },
    "elements": [
        {
            "name": "Cube",
            "from": [ 15.0, 0.0, 0.0 ], 
            "to": [ 16.0, 16.0, 15.0 ], 
            "faces": {
                "north": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 16.0 ] },
                "east": { "texture": "#1", "uv": [ 1.0, 0.0, 16.0, 16.0 ] },
                "south": { "texture": "#0", "uv": [ 15.0, 0.0, 16.0, 16.0 ] },
                "west": { "texture": "#1", "uv": [ 0.0, 0.0, 15.0, 16.0 ] },
                "up": { "texture": "#2", "uv": [ 0.0, 0.0, 1.0, 15.0 ] },
                "down": { "texture": "#2", "uv": [ 0.0, 0.0, 1.0, 15.0 ] }
            }
        },
        {
            "name": "Cube",
            "from": [ 1.0, 0.0, 15.0 ], 
            "to": [ 16.0, 16.0, 16.0 ], 
            "faces": {
                "north": { "texture": "#2", "uv": [ 0.0, 0.0, 15.0, 16.0 ] },
                "east": { "texture": "#1", "uv": [ 0.0, 0.0, 1.0, 16.0 ] },
                "south": { "texture": "#0", "uv": [ 1.0, 0.0, 16.0, 16.0 ] },
                "west": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 16.0 ] },
                "up": { "texture": "#2", "uv": [ 0.0, 0.0, 15.0, 1.0 ] },
                "down": { "texture": "#2", "uv": [ 16.0, 1.0, 0.0, 0.0 ] }
            }
        },
        {
            "name": "Cube",
            "from": [ 0.0, 0.0, 0.0 ], 
            "to": [ 15.0, 16.0, 1.0 ], 
            "faces": {
                "north": { "texture": "#0", "uv": [ 1.0, 0.0, 16.0, 16.0 ] },
                "east": { "texture": "#1", "uv": [ 15.0, 0.0, 16.0, 16.0 ] },
                "south": { "texture": "#2", "uv": [ 0.0, 0.0, 15.0, 16.0 ] },
                "west": { "texture": "#1", "uv": [ 1.0, 0.0, 0.0, 16.0 ] },
                "up": { "texture": "#2", "uv": [ 16.0, 15.0, 2.0, 16.0 ] },
                "down": { "texture": "#2", "uv": [ 1.0, 1.0, 15.0, 15.0 ] }
            }
        },
        {
            "name": "Cube",
            "from": [ 0.0, 0.0, 1.0 ], 
            "to": [ 1.0, 16.0, 16.0 ], 
            "faces": {
                "north": { "texture": "#2", "uv": [ 0.0, 0.0, 1.0, 16.0 ] },
                "east": { "texture": "#1", "uv": [ 0.0, 0.0, 15.0, 16.0 ] },
                "south": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 16.0 ] },
                "west": { "texture": "#1", "uv": [ 1.0, 0.0, 16.0, 16.0 ] },
                "up": { "texture": "#3", "uv": [ 0.0, 1.0, 1.0, 16.0 ] },
                "down": { "texture": "#2", "uv": [ 0.0, 0.0, 1.0, 15.0 ] }
            }
        },
        {
            "name": "Bottom",
            "from": [ 1.0, 0.0, 1.0 ], 
            "to": [ 15.0, 1.0, 15.0 ], 
            "faces": {
                "north": { "texture": "#0", "uv": [ 0.0, 0.0, 14.0, 1.0 ] },
                "east": { "texture": "#2", "uv": [ 0.0, 0.0, 14.0, 1.0 ] },
                "south": { "texture": "#2", "uv": [ 0.0, 0.0, 16.0, -5.0 ] },
                "west": { "texture": "#2", "uv": [ 0.0, 0.0, -13.0, -13.0 ] },
                "up": { "texture": "#2", "uv": [ 1.0, 1.0, 15.0, 15.0 ] },
                "down": { "texture": "#2", "uv": [ 1.0, 1.0, 15.0, 15.0 ] }
            }
        },
        {
            "name": "Fluid",
            "from": [ 1.0, 1.0, 1.0 ], 
            "to": [ 15.0, 15.0, 15.0 ], 
            "faces": {
                "north": { "texture": "#4", "uv": [ 1.0, 1.0, 15.0, 15.0 ] },
                "east": { "texture": "#4", "uv": [ 1.0, 1.0, 15.0, 15.0 ] },
                "south": { "texture": "#4", "uv": [ 1.0, 1.0, 15.0, 15.0 ] },
                "west": { "texture": "#4", "uv": [ 1.0, 1.0, 15.0, 15.0 ] },
                "up": { "texture": "#4", "uv": [ 1.0, 1.0, 15.0, 15.0 ] },
                "down": { "texture": "#4", "uv": [ 1.0, 1.0, 15.0, 15.0 ] }
            }
        },
        {
            "name": "Top",
            "from": [ 1.0, 15.0, 1.0 ], 
            "to": [ 15.0, 16.0, 15.0 ], 
            "faces": {
                "north": { "texture": "#2", "uv": [ 0.0, 0.0, 14.0, 1.0 ] },
                "east": { "texture": "#2", "uv": [ 0.0, 0.0, 14.0, 1.0 ] },
                "south": { "texture": "#2", "uv": [ 0.0, 0.0, 14.0, 1.0 ] },
                "west": { "texture": "#2", "uv": [ 0.0, 0.0, 14.0, 1.0 ] },
                "up": { "texture": "#3", "uv": [ 1.0, 1.0, 15.0, 15.0 ] },
                "down": { "texture": "#2", "uv": [ 1.0, 1.0, 15.0, 15.0 ] }
            }
        }
    ]
}

 

My Forge blockstate file:

{
	"forge_marker": 1,
	"defaults": {
		"model": "eaglesess:liquid_collector"
	},
	"variants": {
		"normal": [{}],
		"inventory": [{}]
	}
}

 

I added some methods to the block:

public static BlockBase fluidcollector = new BlockBase("fluid_collector", Material.WOOD, Main.blocksTab, 1) {
		
		@Override
		public boolean isOpaqueCube(net.minecraft.block.state.IBlockState state) {
			return true;
		};
	    public boolean isFullCube(IBlockState state)
	    {
	        return false;
	    }
		
	};

thx

Edited by tebreca
its solved

 

1 hour ago, tebreca said:

as you can see it works when i hold it

nope, on the fact that the images are very small, and very dark.

 

Try and override the Client-Side only method Block::getBlockLayer, and return BlockRenderLayer#CUTOUT, like Glass.

Also previously known as eAndPi.

"Pi, is there a station coming up where we can board your train of thought?" -Kronnn

Published Mods: Underworld

Handy links: Vic_'s Forge events Own WIP Tutorials.

  • Author
1 hour ago, Matryoshika said:

 

nope, on the fact that the images are very small, and very dark.

 

Try and override the Client-Side only method Block::getBlockLayer, and return BlockRenderLayer#CUTOUT, like Glass.

thanks ill try that

8 hours ago, tebreca said:

as you can see it works when i hold it

/time set 2000

Then take screenshots.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

  • Author
3 minutes ago, Draco18s said:

/time set 2000

Then take screenshots.

im sorry ok, i have my screen at 100% brightness so i saw it as bright

  • Author

for the people watching this with the same question

 

heres what ive got

 @SideOnly(Side.CLIENT)
	    @Override
	    public net.minecraft.util.BlockRenderLayer getBlockLayer() {
	    	return BlockRenderLayer.TRANSLUCENT;
	    }

notice that this is kinda laggy for low end graphics cards

This is better and less graphics card heavy, but it will write you rexture just to a full cube, meaning it not like glass anymore and you cant see trough the block

 @SideOnly(Side.CLIENT)
	    @Override
	    public net.minecraft.util.BlockRenderLayer getBlockLayer() {
	    	return BlockRenderLayer.CUTOUT_MIPPED;
	    }

 

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.