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

Hey, I made item models involving water, and they turned really good... but when i tried blocks, they dont wanna be see-trough :(,

 

I made an example for the sake of showing this,

 

all.png

block.png

 

There you see all the item forms are see-through, and the block is not.

 

BlockState

 

{
    "variants": {
        "normal": { "model": "test:water" },
        "inventory": { "model": "test:water" }
    }
}

 

 

Block model

 

{
    "textures": {
        "wf": "blocks/water_flow",
        "ws": "blocks/water_still"
    },
    "elements": [
        {
            "name": "Water",
            "from": [ 0.0, 0.0, 0.0 ], 
            "to": [ 16.0, 16.0, 16.0 ], 
            "faces": {
                "north": { "texture": "#wf", "uv": [ 0.0, 0.0, 16.0, 16.0 ] },
                "east": { "texture": "#wf", "uv": [ 0.0, 0.0, 16.0, 16.0 ] },
                "south": { "texture": "#wf", "uv": [ 0.0, 0.0, 16.0, 16.0 ] },
                "west": { "texture": "#wf", "uv": [ 0.0, 0.0, 16.0, 16.0 ] },
                "up": { "texture": "#ws", "uv": [ 0.0, 0.0, 16.0, 16.0 ] },
                "down": { "texture": "#ws", "uv": [ 0.0, 0.0, 16.0, 16.0 ] }
            }
        }
    ]
}

 

 

Item model

 

{
    "parent": "test:block/water"
}

 

 

Block class

 

package test.stuff;

import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.util.BlockRenderLayer;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

public class WaterTest extends Block {

public WaterTest() {
	super(Material.WATER);
	this.setRegistryName("water");
	this.setUnlocalizedName("water");
	this.setLightOpacity(0);
	this.setLightLevel(0);
}

@SideOnly(Side.CLIENT)
    public BlockRenderLayer getBlockLayer() {
        return BlockRenderLayer.CUTOUT_MIPPED;
    }

@Override
public boolean isFullCube(IBlockState state) {
        return false;
    }

@Override
public boolean isOpaqueCube(IBlockState state) {
	return false;
}
}

 

 

Item Class

 

package test.stuff;

import net.minecraft.block.Block;
import net.minecraft.item.ItemBlock;
import test.Initialization;

public class WaterTestItem extends ItemBlock{

public WaterTestItem() {
	super(Initialization.WATER);
	this.setRegistryName("waterItem");
        this.setUnlocalizedName("waterItem");
}

}

 

 

Initialization class

 

package test;

import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraftforge.client.model.ModelLoader;
import net.minecraftforge.fml.common.registry.GameRegistry;
import test.stuff.WaterTest;
import test.stuff.WaterTestItem;

public class Initialization {

public static WaterTest WATER;
public static WaterTestItem WATERITEM;

public static void Init() {
	WATER = new WaterTest();
	WATERITEM = new WaterTestItem();
}

public static void Register() {
	GameRegistry.register(WATER);
	GameRegistry.register(WATERITEM);
}

public static void RegisterModels() {
	ModelResourceLocation model;
	model= new ModelResourceLocation(WATER.getRegistryName(), "inventory");
        ModelLoader.setCustomModelResourceLocation(WATERITEM, 0, model);
        model = new ModelResourceLocation(WATERITEM.getRegistryName(), "inventory");
        ModelLoader.setCustomModelResourceLocation(WATERITEM, 0, model);
}
}

 

 

Am I doing something wrong? :(

Is it not possible due to water texture implementation?

 

Thanks in advance,

NewDivide

return BlockRenderLayer.CUTOUT_MIPPED;

 

Cutout means that the alpha transparency is either 0 or 1.

You want BlockRenderLayer.TRANSPARENT;

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.

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.