Jump to content

[SOLVED] Need help with Custom Entity


Szymeon

Recommended Posts

I made entity from this tutorial: https://www.youtube.com/watch?v=p6FFl3yN18M

But i made model in blockbench bcs tabula has lags.

In BlockBench i had to download plugin for export .java file, so i did it and its here:

package com.Szymeon.knightsmod.entity.model;

import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity;

public class ModelOrk extends ModelBase {

    //fields
    ModelRenderer e0;
    ModelRenderer e1;
    ModelRenderer e2;
    ModelRenderer e3;
    ModelRenderer e4;
    ModelRenderer e5;
    ModelRenderer e6;
    ModelRenderer e7;
    ModelRenderer e8;
    ModelRenderer e9;
    ModelRenderer e10;

    public ModelOrk() {
        this.textureWidth = 128;
        this.textureHeight = 128;

        this.e0 = new ModelRenderer(this, 0, 0);
        this.e0.addBox(-9F, 22F, -6F, 18, 12, 12, 1.0F);
        this.e1 = new ModelRenderer(this, 0, 0);
        this.e1.addBox(-6.5F, 17F, -5F, 13, 5, 9, 1.0F);
        this.e2 = new ModelRenderer(this, 0, 0);
        this.e2.addBox(-5F, 34F, -7.5F, 9, 11, 11, 1.0F);
        this.e3 = new ModelRenderer(this, 0, 0);
        this.e3.addBox(-12F, 16F, -3F, 3, 11, 4, 1.0F);
        this.e4 = new ModelRenderer(this, 0, 0);
        this.e4.addBox(-12F, 14F, -4F, 3, 2, 5, 1.0F);
        this.e5 = new ModelRenderer(this, 0, 0);
        this.e5.addBox(-13F, 26F, -4F, 5, 8, 6, 1.0F);
        this.e6 = new ModelRenderer(this, 0, 0);
        this.e6.addBox(8F, 26F, -4F, 5, 8, 6, 1.0F);
        this.e7 = new ModelRenderer(this, 0, 0);
        this.e7.addBox(9F, 14F, -4F, 3, 2, 5, 1.0F);
        this.e8 = new ModelRenderer(this, 0, 0);
        this.e8.addBox(9F, 16F, -3F, 3, 11, 4, 1.0F);
        this.e9 = new ModelRenderer(this, 0, 0);
        this.e9.addBox(1.5F, 0F, -3F, 6, 17, 5, 1.0F);
        this.e10 = new ModelRenderer(this, 0, 0);
        this.e10.addBox(-7.5F, 0F, -3F, 6, 17, 5, 1.0F);

    }

    @Override
    public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {
        this.e0.render(f5);
        this.e1.render(f5);
        this.e2.render(f5);
        this.e3.render(f5);
        this.e4.render(f5);
        this.e5.render(f5);
        this.e6.render(f5);
        this.e7.render(f5);
        this.e8.render(f5);
        this.e9.render(f5);
        this.e10.render(f5);

    }

    public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) {
        modelRenderer.rotateAngleX = x;
        modelRenderer.rotateAngleY = y;
        modelRenderer.rotateAngleZ = z;
    }
}

 

But my entity looks like this:

bugged.png

 

Should looks like this:

should looks like this.png

Anyone know what's wrong?

Edited by Szymeon
Link to comment
Share on other sites

Show your rendering code please

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

Link to comment
Share on other sites

package com.Szymeon.knightsmod.entity.render;

import com.Szymeon.knightsmod.Main;
import com.Szymeon.knightsmod.entity.EntityOrk;
import com.Szymeon.knightsmod.entity.model.ModelOrk;

import net.minecraft.client.model.ModelBase;
import net.minecraft.client.renderer.entity.RenderLiving;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.util.ResourceLocation;

public class RenderOrk extends RenderLiving<EntityOrk>
{
	public static final ResourceLocation TEXTURES = new ResourceLocation(Main.MOD_ID + ":textures/entity/ork.png");

	public RenderOrk(RenderManager manager)
	{
		super(manager, new ModelOrk(), 0.5F);
	}
	
	@Override
	protected ResourceLocation getEntityTexture(EntityOrk entity)
	{
		return TEXTURES;
	}
	
	@Override
	protected void applyRotations(EntityOrk entityLiving, float p_77043_2_, float rotationYaw, float partialTicks)
	{
		super.applyRotations(entityLiving, p_77043_2_, rotationYaw, partialTicks);
	}
}

 

Link to comment
Share on other sites

Most models are created upside down because of how texture coordinates work. It’s easier for humans to create them upside down and then rotate them in the rendering. This is because texture coordinates (UV) have the V axis going down when pretty much every axis ever goes up. Here are a couple diagrams to illustrate this43350675-C0BC-4ECC-8B0E-E5B93730E52D.png.f47a47753bf07c6df5ce6739923055b9.png93E43563-356B-4321-9448-DF1AF11CADC8.thumb.png.d61081d51313dd2fa05182dc8ff71249.png

  • Like 1

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

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.