Jump to content

[1.7.10] SOLVED OBJ As 3D rendered item


Recommended Posts

Hello all.


I am trying to use a .obj in my mod as 3d rendered item. The reason for it is because Techne isn't really great for high detailed models.


I tried to follow this http://www.minecraftforge.net/wiki/Using_wavefront_model tutorial but that is for blocks and not for items. The things I tried don't works because it always crashed on de model.renderAll() function


Here is my test code




package starglas.dsremake.renderer;


import net.minecraft.client.Minecraft;

import net.minecraft.item.ItemStack;

import net.minecraft.util.ResourceLocation;

import net.minecraftforge.client.IItemRenderer;

import net.minecraftforge.client.IItemRenderer.ItemRenderType;

import net.minecraftforge.client.model.AdvancedModelLoader;

import net.minecraftforge.client.model.IModelCustom;


import org.lwjgl.opengl.GL11;


import starglas.dsremake.common.block.TESnowball;

import starglas.dsremake.common.helpers.Reference;

import starglas.dsremake.common.models.paladinglaive;


public class TESRSnowball implements IItemRenderer {

IModelCustom model;

ResourceLocation texture = new ResourceLocation(Reference.MODID,



public TESRSnowball(){

IModelCustom model = AdvancedModelLoader.loadModel(new ResourceLocation(

Reference.MODID, "obj/lance.obj"));




public boolean handleRenderType(ItemStack item, ItemRenderType type) {




return true;


return false;





public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item,

ItemRendererHelper helper) {

// TODO Auto-generated method stub

return false;



public void renderItem(ItemRenderType type, ItemStack item, Object... data) {




GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);

GL11.glTranslatef(0F, 0F, 0F);












package starglas.dsremake.client;


import net.minecraft.item.Item;

import net.minecraftforge.client.IItemRenderer;

import net.minecraftforge.client.MinecraftForgeClient;

import starglas.dsremake.common.CommonProxy;

import starglas.dsremake.common.block.ModBlocks;

import starglas.dsremake.common.block.TileEntityBonfire;

import starglas.dsremake.common.helpers.RegisterHelper;

import starglas.dsremake.common.items.ModItems;

import starglas.dsremake.renderer.ItemRendererBlockBonfire;

import starglas.dsremake.renderer.ItemRendererLongSword;

import starglas.dsremake.renderer.ItemRendererPaladinGlaive;

import starglas.dsremake.renderer.RendererBonfire;

import starglas.dsremake.renderer.TESRSnowball;

import cpw.mods.fml.client.registry.ClientRegistry;

import cpw.mods.fml.common.registry.GameRegistry;


public class ClientProxy extends CommonProxy {

public void registerRenderers(){

MinecraftForgeClient.registerItemRenderer(ModItems.longSword, (IItemRenderer)new ItemRendererLongSword());

MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.blockBonfire), (IItemRenderer)new ItemRendererBlockBonfire());

GameRegistry.registerTileEntity(TileEntityBonfire.class, "blockBonfire");

ClientRegistry.bindTileEntitySpecialRenderer(TileEntityBonfire.class, new RendererBonfire());

RegisterHelper.registerRender(ModItems.PaladinGlaive, new ItemRendererPaladinGlaive());

MinecraftForgeClient.registerItemRenderer(ModItems.MK1BloodStone, new TESRSnowball());






I hope someone can help me because it will be really nice to have 3D textures


EDIT. Welp, I removed some coded and now it works strangly enough, so mods this threat can be deleted

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.

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.

  • Create New...

Important Information

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