Jump to content

[1.8]Item rendering as a block


memcallen

Recommended Posts

I've been trying to texture my item (unsuccessfully) and for whatever reason the model thinks that it's a block. I don't have any code that says it's an item block, but I still have no idea how the json texturing system works. This is my json file:

{
    "parent": "builtin/generated",
    "textures": {
        "layer0": "Ancients:items/Rubble"
    },
    "display": {
        "thirdperson": {
            "rotation": [ -90, 0, 0 ],
            "translation": [ 0, 1, -3 ],
            "scale": [ 0.55, 0.55, 0.55 ]
        },
        "firstperson": {
            "rotation": [ 0, -135, 25 ],
            "translation": [ 0, 4, 2 ],
            "scale": [ 1.7, 1.7, 1.7 ]
        }
    }
}

Also, how can I texture it? I can't seem to figure it out.

The proud(ish) developer of Ancients

Link to comment
Share on other sites

This is my food class right now:

 

package com.ProfitOrange.moshiz.init;

import com.ProfitOrange.moshiz.MoShizMain;
import com.ProfitOrange.moshiz.Reference;

import net.minecraft.client.Minecraft;
import net.minecraft.client.resources.model.ModelResourceLocation;
import net.minecraft.item.Item;
import net.minecraft.item.ItemFood;
import net.minecraftforge.fml.common.registry.GameRegistry;

public class MoShizFoods {



public static Item beefSandwich;



public static void init()
{
	beefSandwich = new ItemFood(8, 0.8F, false).setUnlocalizedName("beefSandwich").setCreativeTab(MoShizMain.tabGems);



}

public static void register()
{
	GameRegistry.registerItem(beefSandwich, beefSandwich.getUnlocalizedName().substring(5));


}

public static void registerRenders()
{
	registerRender(beefSandwich);


}

public static void registerRender(Item item)
{
	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new ModelResourceLocation(Reference.MOD_ID + ":" + item.getUnlocalizedName().substring(5), "inventory"));;
}
}

 

Then my preInit method in my main class:

@EventHandler
public void preInit(FMLPreInitializationEvent event)
{
	MoShizFoods.init();
	MoShizFoods.register();
}

In my ClientProxy class:

@Override
public void registerRenders()
{
	MoShizFoods.registerRenders();
}

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



×
×
  • Create New...

Important Information

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