Jump to content

The model does not appear


Recommended Posts

I know this topic was discussed a thousand times, but I have not found a good answer, which would have helped me. Maybe you can help me?

Problem: registered render, entity, model, but in the game is the new model is shown as a model player (ModelBiped)






package ***; //Secret :)


import net.minecraft.src.EntityLiving;

import net.minecraft.src.RenderLiving;


import org.lwjgl.opengl.GL11;


public class RenderVampire extends RenderLiving


protected ModelVampire field_40295_c;

public RenderVampire(ModelVampire ModelVampire, float f)


super(ModelVampire, f);

field_40295_c = (ModelVampire)mainModel;



public void renderNamehereA(EntityVampire entity, double d, double d1, double d2, float f, float f1)


super.doRenderLiving(entity, d, d1, d2, f, f1);




public void doRenderLiving(EntityLiving entityliving, double d, double d1, double d2, float f, float f1)


super.doRenderLiving((EntityVampire) entityliving, d, d1, d2, f, f1);



public void renderDeadmau5(EntityVampire par1EntityVampire, double par2, double par4, double par6, float par8, float par9)


super.doRenderLiving(par1EntityVampire, par2, par4, par6, par8, par9);



protected void func_40291_a(EntityVampire par1EntityVampire, float par2)


super.renderEquippedItems(par1EntityVampire, par2);




protected void func_40290_a(EntityVampire EntityVampire, double d, double d1, double d2)



protected void renderEquippedItems(EntityLiving par1EntityLiving, float par2)


func_40291_a((EntityVampire)par1EntityLiving, par2);



protected void preRenderScale(EntityVampire entity, float f)


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


protected void func_40292_b(EntityVampire par1EntityVampire, float par2)


float f = 0.9375F;


GL11.glScalef(f, f, f);



protected void passSpecialRender(EntityLiving par1EntityLiving, double par2, double par4, double par6)


func_40290_a((EntityVampire)par1EntityLiving, par2, par4, par6);


protected void Vampire(EntityLiving par1EntityLiving, float par2)


func_40292_b((EntityVampire)par1EntityLiving, par2);









package ***;

import net.minecraft.src.*;


public class ModelVampire extends ModelBase



    ModelRenderer head;

    ModelRenderer body;

    ModelRenderer rightarm;

    ModelRenderer leftarm;

    ModelRenderer rightleg;

    ModelRenderer leftleg;


  public ModelVampire()


    textureWidth = 64;

    textureHeight = 32;


      head = new ModelRenderer(this, 0, 0);

      head.addBox(-4F, -8F, -4F, 8, 8, 8);

      head.setRotationPoint(0F, 3F, -1F);

      head.setTextureSize(64, 32);

      head.mirror = true;

      setRotation(head, 0F, 0F, 0F);

      body = new ModelRenderer(this, 16, 16);

      body.addBox(-4F, 0F, -2F, 8, 12, 4);

      body.setRotationPoint(0F, 2F, 0F);

      body.setTextureSize(64, 32);

      body.mirror = true;

      setRotation(body, 0.4461433F, 0F, 0F);

      rightarm = new ModelRenderer(this, 40, 16);

      rightarm.addBox(-3F, -2F, -2F, 4, 12, 4);

      rightarm.setRotationPoint(-4F, 5F, 2F);

      rightarm.setTextureSize(64, 32);

      rightarm.mirror = true;

      setRotation(rightarm, 0.8551081F, 0F, 0.4089647F);

      leftarm = new ModelRenderer(this, 40, 16);

      leftarm.addBox(-1F, -2F, -2F, 4, 12, 4);

      leftarm.setRotationPoint(4F, 5F, 2F);

      leftarm.setTextureSize(64, 32);

      leftarm.mirror = true;

      setRotation(leftarm, 0.8353827F, 0F, -0.4089647F);

      rightleg = new ModelRenderer(this, 0, 16);

      rightleg.addBox(-2F, 0F, -2F, 4, 12, 4);

      rightleg.setRotationPoint(-2F, 12F, 4F);

      rightleg.setTextureSize(64, 32);

      rightleg.mirror = true;

      setRotation(rightleg, 0F, 0F, 0F);

      leftleg = new ModelRenderer(this, 0, 16);

      leftleg.addBox(-2F, 0F, -2F, 4, 12, 4);

      leftleg.setRotationPoint(2F, 12F, 4F);

      leftleg.setTextureSize(64, 32);

      leftleg.mirror = true;

      setRotation(leftleg, 0F, 0F, 0F);



  public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5)


    super.render(entity, f, f1, f2, f3, f4, f5);

    setRotationAngles(f, f1, f2, f3, f4, f5, entity);









  private void setRotation(ModelRenderer model, float x, float y, float z)


    model.rotateAngleX = x;

    model.rotateAngleY = y;

    model.rotateAngleZ = z;



  public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, Entity par7Entity)


    super.setRotationAngles(par1, par2, par3, par4, par5, par6, par7Entity);








package ***;


import net.minecraft.client.Minecraft;

import net.minecraft.src.EntityRenderer;

import net.minecraft.src.RenderLiving;

import net.minecraft.src.RenderSnowball;

import net.minecraft.src.ScaledResolution;

import net.minecraft.src.Tessellator;

import net.minecraftforge.client.MinecraftForgeClient;

import net.minecraftforge.common.MinecraftForge;


import org.lwjgl.input.Mouse;

import org.lwjgl.opengl.GL11;


import cpw.mods.fml.client.FMLClientHandler;

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

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

import cpw.mods.fml.common.ObfuscationReflectionHelper;


public class ClientProxy extends CommonProxy



public void registerRenders()





  RenderingRegistry.instance().registerEntityRenderingHandler(EntityMagicBullet.class, new RenderSnowball(SMCrafting.MagicBullet.getIconFromDamage(0)));

  RenderingRegistry.registerEntityRenderingHandler(EntityVampire.class, new RenderLiving(new ModelVampire(),0.5F));



// Override any other methods that need to be handled differently client side.


}// End class ClientProxy





package ***;


public class CommonProxy {

public static String ITEMS_PNG = "path";

public static String BLOCK_PNG = "path";


// Client stuff

public void registerRenderers() {

// Nothing here as this is the server side proxy







public void load(FMLInitializationEvent event){

NetworkRegistry.instance().registerGuiHandler(this, guiHandler);

LanguageRegistry.instance().addStringLocalization("entity.Vampire.name", "en_US", "Vampire");

EntityRegistry.registerGlobalEntityID(EntityVampire.class, "Santa", ModLoader.getUniqueEntityId(), 11 ,115);

EntityList.entityEggs.put(Integer.valueOf(30), new EntityEggInfo(30, 894731, (new Color(21, 15, 6)).getRGB()));


//And much, but I showed you only, due to the ENTITY




Please help me




Link to comment
Share on other sites

I have not really looked at models much, but here is code I puled from ModelBat



ModelRenderer var1 = new ModelRenderer(this, 24, 0);

        var1.addBox(-4.0F, -6.0F, -2.0F, 3, 4, 1);


        ModelRenderer var2 = new ModelRenderer(this, 24, 0);

        var2.mirror = true;

        var2.addBox(1.0F, -6.0F, -2.0F, 3, 4, 1);



If not, then just take a look at the model that you are basing it off of and make sure that you have made it with all the right params and variables

The Korecraft Mod

Link to comment
Share on other sites

RenderingRegistry.registerEntityRenderingHandler(EntityVampire.class, new RenderLiving(new ModelVampire(),0.5F));


RenderLiving should be your own renderer



Doesn't work for me. As soon as i register 2 entities one overwrites the other.


And use @Override above methods you are overriding. It is possible that one of your method names is outdated and doesn't work anymore

Link to comment
Share on other sites

Sure, here are my source files:


public void load(FMLInitializationEvent event) {
registerEntity(EntityFireBolt.class, new RenderBolt(0), "fireBolt", "a hot ball of fire", 1, 64, 10, true);

private void registerEntity(Class <? extends Entity> entityClass, Render renderer, String entityName, String description, int id, int trackingRange, int updateFrequency, boolean sendsVelocityUpdates) {
	RenderingRegistry.registerEntityRenderingHandler(entityClass, renderer);
	EntityRegistry.registerModEntity(entityClass, entityName, id, Scrolls.instance, trackingRange, updateFrequency, sendsVelocityUpdates);
	LanguageRegistry.instance().addStringLocalization("entity.Scrolls." + entityName + ".name", description);

One of the entities:

public class EntityEarthBolt extends EntityBolt {
public EntityEarthBolt(World world) {

public EntityEarthBolt(World world, EntityLiving entity, double powerMod) {
        super(world, entity, powerMod, 10);

As you can see EntityBolt is a throwable. I'm just showing the necessary stuff here

public class EntityBolt extends EntityThrowable {
    public EntityBolt(World world) {

    public EntityBolt(World world, EntityLiving entity, double powerMod, int defaultDamage) {
        super(world, entity);

The paramater type in the constructor is just something I added, you don't need it

public class RenderBolt extends Render {

public ModelBase modelbolt;
public float rotationSpeed;

public RenderBolt(int type) {
	modelbolt = new ModelBolt(type);

public void doRenderBolt(EntityBolt var1, double var2, double var4, double var6, float var8, float var9) {
        float var10 = (float)var1.innerRotation + var9;
        GL11.glTranslatef((float)var2, (float)var4, (float)var6);
        modelbolt.render(var1, 0.0F, var10 * this.rotationSpeed, 0.0F, 0.0F, 0.0F, 0.0625F);

    public void doRender(Entity par1Entity, double par2, double par4, double par6, float par8, float par9) {
        this.doRenderBolt((EntityBolt)par1Entity, par2, par4, par6, par8, par9);

Last but not least, the model:

Please not that the rotations in render(...) are not necessary

public class ModelBolt extends ModelBase {

public ModelRenderer box;
public ModelRenderer box0;
public ModelRenderer box1;

public ModelBolt(int type) {
	this.textureWidth = 128;
	this.textureHeight = 48;

	box = new ModelRenderer(this, type*32, 0);
	box.addBox(-4F, -4F, -4F, 8, 8, ;
	box.setRotationPoint(0F, 0F, 0F);

	box0 = new ModelRenderer(this, type*32, 16);
	box0.addBox(-4F, -4F, -4F, 8, 8, ;
	box0.setRotationPoint(0F, 0F, 0F);

	box1 = new ModelRenderer(this, type*32, 32);
	box1.addBox(-4F, -4F, -4F, 8, 8, ;
	box1.setRotationPoint(0F, 0F, 0F);

public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {	
        GL11.glRotatef(30.0F, 0.7F, 0.0F, 0.7F);
        GL11.glRotatef(f1, 0.0F, 1.0F, 0.0F);
        GL11.glRotatef(60.0F, 0.8F, 0.0F, 0.8F);
        GL11.glRotatef(f1, 0.0F, 1.0F, 0.0F);
        GL11.glRotatef(90.0F, 0.9F, 0.0F, 0.9F);
        GL11.glRotatef(f1, 0.0F, 1.0F, 0.0F);



What the hell is mainModel here?

field_40295_c = (ModelVampire)mainModel;

It should be:

field_40295_c = new ModelVampire();

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in

Sign In Now


  • Create New...

Important Information

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