Jump to content

Recommended Posts

Posted

I just hopped into modding and was creating a few blocks for a little testing mod, but one of the blocks isn't displaying its texture when placed in the world, even tho I basically copied the model files of  another block and changed the names. When in item form the texture is shown correctly. Can someone explain me where the source of the problem is? The code samples are below:

 

Block model File

{
    "parent": "block/cube_all",
    "textures": {
        "all": "crystal:blocks/crystalDustBlock"
    }
}

 

Item model file

{
    "parent":"crystal:block/crystalDustBlock",
    "display": {
        "thirdperson": {
            "rotation": [ 10, -45, 170 ],
            "translation": [ 0, 1.5, -2.75 ],
            "scale": [ 0.375, 0.375, 0.375 ]
        }
    }
}

 

Block Registration

public final class ModBlocks {

public static Block crystalOre;
public static Block crystalDustBlock;
public static Block crystalizer;

    public static final void createBlocks() {
        GameRegistry.registerBlock(crystalOre = new CrystalOre(),"crystalOre");
        GameRegistry.registerBlock(crystalDustBlock = new CrystalDustBlock(), "crystalDustBlock");
        GameRegistry.registerBlock(crystalizer = new Crystalizer(false), "crystalizer");
    }
}

 

BlockRenderRegister:

public final class BlockRenderRegister {
public static String modid = Main.MODID;

public static void registerBlockRenderer() {
    reg(ModBlocks.crystalOre);
    reg(ModBlocks.crystalDustBlock);
    reg(ModBlocks.crystalizer);
}

public static void reg(Block block) {
    Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(Item.getItemFromBlock(block), 0, new ModelResourceLocation(modid + ":" + block.getUnlocalizedName().substring(5), "inventory"));
}
}

 

The location of the texture is C:\Users\%My Username%\Desktop\Mod\src\main\resources\assets\crystal\textures\blocks\crystalDustBlock.png

Posted

Do you have a blockstates file for the new block?

 

Try following The Grey Ghost's blog post on troubleshooting model errors.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

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



×
×
  • Create New...

Important Information

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