Jump to content

[1.14.4] How to get Minecraft Horse model/texture to make a custom unicorn?


DragonITA

Recommended Posts

2 hours ago, DragonITA said:

Ok, thx, but i want make a horse, with horse animations and horse gui and etc. and i dont want write the code of AbstractHorse, i can copy, ok, but then?

ModelUnicorn should extend ModelHorse. Everything else you want will come from your UnicornEntity class extending EntityHorse.

  • Thanks 1
Link to comment
Share on other sites

15 minutes ago, salvestrom said:

ModelUnicorn should extend ModelHorse. Everything else you want will come from your UnicornEntity class extending EntityHorse.

No, you have said that i should make that modelUnicorn extends ModelEntity and not ModelHorse, but i need the AbstractHorseEntity, else the gui, animations and etc. wont work and i should rewrite the code.

New in Modding? == Still learning!

Link to comment
Share on other sites

2 hours ago, DragonITA said:

No, you have said that i should make that modelUnicorn extends ModelEntity and not ModelHorse, but i need the AbstractHorseEntity, else the gui, animations and etc. wont work and i should rewrite the code.

I did not say at any point that your model should extend model entity.

 

This requires three classes. Your entity class should extend HorseEntity giving you access to all of the GUI, saddling and taming. Your render class should be adjusted to not be using the superfluous classy created, as I previously mentioned. Your model class needs to extend HorseModel – this is how you will inherit the animations and bulk of the model.

 

Note that AbstractHorseEntity does not have all of the code for horses, only the shared code between the various horse entities.

Edited by salvestrom
Additional information.
  • Like 1
Link to comment
Share on other sites

8 hours ago, salvestrom said:

I did not say at any point that your model should extend model entity.

 

This requires three classes. Your entity class should extend HorseEntity giving you access to all of the GUI, saddling and taming. Your render class should be adjusted to not be using the superfluous classy created, as I previously mentioned. Your model class needs to extend HorseModel – this is how you will inherit the animations and bulk of the model.

 

Note that AbstractHorseEntity does not have all of the code for horses, only the shared code between the various horse entities.

Sorry, ok thx i want test it

New in Modding? == Still learning!

Link to comment
Share on other sites

17 hours ago, salvestrom said:

I did not say at any point that your model should extend model entity.

 

This requires three classes. Your entity class should extend HorseEntity giving you access to all of the GUI, saddling and taming. Your render class should be adjusted to not be using the superfluous classy created, as I previously mentioned. Your model class needs to extend HorseModel – this is how you will inherit the animations and bulk of the model.

 

Note that AbstractHorseEntity does not have all of the code for horses, only the shared code between the various horse entities.

Ok, but i need to add the corn, then i should make a sort of my personalized model, or not? I have copied the HorseModel, changed his Name and added the corn.

New in Modding? == Still learning!

Link to comment
Share on other sites

On 12/9/2019 at 8:56 PM, Lea9ue said:

There is literally zero reasons for you to be using Tabula or BlockBench to add a horn to a horse. You already have Horsemodel. You already have a texture file for a horse that you can add texture to make the horn.  I have a feeling that you are just lost.  You should then add a box like I said before to your model class.


  this.corn.addBox(.....);

 Then right here is the coordinates of the texture on the png.


this.corn = new RendererModel(this, number, number);

The 2 numbers tell exactly where the texture is located on png.

 

 

Who i should add this code(i arleady added it, but i think i added it to the wrong place)

New in Modding? == Still learning!

Link to comment
Share on other sites

package net.batonfack.fantasymod.client.renders;

import net.batonfack.fantasymod.FantasyMod;
import net.batonfack.fantasymod.client.models.ModelUnicornWitoutAbstracHorse;
import net.batonfack.fantasymod.entities.UnicornEntity;
import net.minecraft.client.renderer.entity.EntityRenderer;
import net.minecraft.client.renderer.entity.EntityRendererManager;
import net.minecraft.client.renderer.entity.MobRenderer;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.fml.client.registry.IRenderFactory;

@OnlyIn(Dist.CLIENT)
public class UnicornEntityRender extends MobRenderer<UnicornEntity, ModelUnicornWitoutAbstracHorse<UnicornEntity>>
{
	//public UnicornEntityRender(EntityRendererManager manager) {
	//	super(manager, new UnicornEntityModel(0), 0f);
	//}
	
	private static ModelUnicornWitoutAbstracHorse<UnicornEntity> UnicornModel;
	private static float shadowOpaque = 0.0f;
	
	public UnicornEntityRender(EntityRendererManager manager, ModelUnicornWitoutAbstracHorse<UnicornEntity> UnicornModel, float p_i50961_3_) {
		super(manager, UnicornModel, p_i50961_3_);
	}

	@Override
	protected ResourceLocation getEntityTexture(UnicornEntity entity) {
		return FantasyMod.location("textures/entity/unicorn_entity.png");
	}
	
	public static class RenderFactory implements IRenderFactory<UnicornEntity>
	{

		@Override
		public EntityRenderer<? super UnicornEntity> createRenderFor(EntityRendererManager manager) {
			return new UnicornEntityRender(manager, UnicornModel, shadowOpaque);
		}
	}
}

 

New in Modding? == Still learning!

Link to comment
Share on other sites

package net.batonfack.fantasymod.entities;

import net.batonfack.fantasymod.init.FantasyModEntities;
import net.minecraft.entity.EntityType;
import net.minecraft.entity.passive.horse.HorseEntity;
import net.minecraft.world.World;

public class UnicornEntity extends HorseEntity
{

	@SuppressWarnings("unchecked")
	public UnicornEntity(EntityType<? extends HorseEntity> type, World worldIn)
	{
		super((EntityType<? extends HorseEntity>) FantasyModEntities.UNICORN_ENTITY, worldIn);
	}
	
}

 

New in Modding? == Still learning!

Link to comment
Share on other sites

package net.batonfack.fantasymod.client.models;

import net.minecraft.client.renderer.entity.model.EntityModel;
import net.minecraft.client.renderer.entity.model.RendererModel;
import net.minecraft.client.renderer.model.ModelBox;
import net.minecraft.entity.LivingEntity;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;

@OnlyIn(Dist.CLIENT)
public class ModelUnicornWitoutAbstracHorse<T extends LivingEntity> extends EntityModel<T> {
   protected final RendererModel field_217127_a;
   protected final RendererModel field_217128_b;
   private final RendererModel CornGroup;
   private final RendererModel Corn1;
   private final RendererModel Corn2;
   private final RendererModel Corn3;

   public ModelUnicornWitoutAbstracHorse(float p_i51065_1_) {
	      this.field_217127_a = null;
		  this.field_217128_b = null;
		  this.textureWidth = 128;
	      this.textureHeight = 64;
	      
	      
	      CornGroup = new RendererModel(this);
	      CornGroup.setRotationPoint(0.0F, 0.0F, 0.0F);
		  Corn1 = new RendererModel(this, 64, 0);
		  Corn1.setRotationPoint(1.5F, -5.0F, -15.0F);
		  this.Corn1.setRotationPoint(0.5409F, 0.0F, 0.0F);
		  CornGroup.addChild(Corn1);
		  Corn1.cubeList.add(new ModelBox(Corn1, 52, 57, -3.0F, -3.0F, -4.0F, 3, 4, 3, 0.0F, true));
		  
		  Corn2 = new RendererModel(this, 64, 28);
		  Corn2.setRotationPoint(1.5F, -5.0F, -15.0F);
		  this.Corn2.setRotationPoint(0.5409F, 0.0F, 0.0F);
		  CornGroup.addChild(Corn2);
		  Corn2.cubeList.add(new ModelBox(Corn2, 0, 0, -2.4F, -5.3F, -3.6F, 2, 3, 2, 0.0F, true));
		  
		  Corn3 = new RendererModel(this, 96, 32);
		  Corn3.setRotationPoint(1.5F, -5.0F, -15.0F);
		  this.Corn3.setRotationPoint(0.5409F, 0.0F, 0.0F);
		  CornGroup.addChild(Corn3);
		  Corn3.cubeList.add(new ModelBox(Corn3, 0, 0, -1.8F, -8.1F, -3.2F, 1, 3, 1, 0.0F, true));
   }

   protected void func_199047_a(RendererModel p_199047_1_) {
      RendererModel renderermodel = new RendererModel(this, 19, 16);
      renderermodel.addBox(0.55F, -13.0F, 4.0F, 2, 3, 1, -0.001F);
      RendererModel renderermodel1 = new RendererModel(this, 19, 16);
      renderermodel1.addBox(-2.55F, -13.0F, 4.0F, 2, 3, 1, -0.001F);
      p_199047_1_.addChild(renderermodel);
      p_199047_1_.addChild(renderermodel1);
   }
}

 

New in Modding? == Still learning!

Link to comment
Share on other sites

i think whoever's bugging me in the HorseEntity Class is, here:

  private static final String[] HORSE_TEXTURES = new String[]{"textures/entity/horse/horse_white.png", "textures/entity/horse/horse_creamy.png", "textures/entity/horse/horse_chestnut.png", "textures/entity/horse/horse_brown.png", "textures/entity/horse/horse_black.png", "textures/entity/horse/horse_gray.png", "textures/entity/horse/horse_darkbrown.png"};

 

New in Modding? == Still learning!

Link to comment
Share on other sites

5 hours ago, DragonITA said:

private static ModelUnicornWitoutAbstracHorse<UnicornEntity> UnicornModel; 

Remove this and put this in the constructor super "new UnicornModel<>(0)". The model file has to extend HorseModel Or you will not get the animations.

In the renderer Create:    

Quote

public static final ResourceLocation unicorn= new ResourceLocation("[Your mod ID]:"textures/entity/unicorn_entity.png"

 And return "unicorn" in getEntityTexture.

");

  • Like 1
Link to comment
Share on other sites

package net.batonfack.fantasymod.client.renders;

import net.batonfack.fantasymod.FantasyMod;
import net.batonfack.fantasymod.client.models.ModelUnicornWithAbstracHorse;
import net.batonfack.fantasymod.client.models.ModelUnicornWitoutAbstracHorse;
import net.batonfack.fantasymod.entities.UnicornEntity;
import net.minecraft.client.renderer.entity.AbstractHorseRenderer;
import net.minecraft.client.renderer.entity.EntityRenderer;
import net.minecraft.client.renderer.entity.EntityRendererManager;
import net.minecraft.client.renderer.entity.MobRenderer;
import net.minecraft.entity.passive.horse.AbstractHorseEntity;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.fml.client.registry.IRenderFactory;

@OnlyIn(Dist.CLIENT)
public class UnicornEntityRender extends AbstractHorseRenderer<UnicornEntity, ModelUnicornWithAbstracHorse<AbstractHorseEntity>> // <<---The Line with the error
 {
	//public UnicornEntityRender(EntityRendererManager manager) {
	//	super(manager, new UnicornEntityModel(0), 0f);
	//}
	
	//private static ModelUnicornWitoutAbstracHorse<UnicornEntity> UnicornModel;
	public static final ResourceLocation unicorn = new ResourceLocation("fantasymod:" + "textures/entity/unicorn_entity.png");
	private static float shadowOpaque = 0.0f;
	
	public UnicornEntityRender(EntityRendererManager manager, ModelUnicornWithAbstracHorse<AbstractHorseEntity> UnicornModel, float p_i50961_3_) {
		super(manager, new ModelUnicornWithAbstracHorse<>(0.0f), p_i50961_3_);
	}

	@Override
	protected ResourceLocation getEntityTexture(UnicornEntity entity) {
		return unicorn;
	}
	
	public static class RenderFactory implements IRenderFactory<UnicornEntity>
	{

		@Override
		public EntityRenderer<? super UnicornEntity> createRenderFor(EntityRendererManager manager) {
			return new UnicornEntityRender(manager, new ModelUnicornWithAbstracHorse<>(0.0f), shadowOpaque);
		}
	}
}

 

Edited by DragonITA

New in Modding? == Still learning!

Link to comment
Share on other sites

46 minutes ago, DragonITA said:



public class UnicornEntityRender extends AbstractHorseRenderer<UnicornEntity, ModelUnicornWithAbstracHorse<AbstractHorseEntity>> // <<---The Line with the error
 

 

What is the error if you use unicorn entity instead of AbstractHorseEntity?

Please post the code for registering your renderer.

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




  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • ASIABET adalah pilihan terbaik bagi Anda yang mencari slot gacor hari ini dengan server Rusia dan jackpot menggiurkan. Berikut adalah beberapa alasan mengapa Anda harus memilih ASIABET: Slot Gacor Hari Ini Kami menyajikan koleksi slot gacor terbaik yang diperbarui setiap hari. Dengan fitur-fitur unggulan dan peluang kemenangan yang tinggi, Anda akan merasakan pengalaman bermain yang tak terlupakan setiap kali Anda memutar gulungan. Server Rusia yang Handal Kami menggunakan server Rusia yang handal dan stabil untuk memastikan kelancaran dan keadilan dalam setiap putaran permainan. Anda dapat bermain dengan nyaman tanpa khawatir tentang gangguan atau lag. Jackpot Menggiurkan Nikmati kesempatan untuk memenangkan jackpot menggiurkan yang dapat mengubah hidup Anda secara instan. Dengan hadiah-hadiah besar yang ditawarkan, setiap putaran permainan bisa menjadi peluang untuk meraih keberuntungan besar.
    • Sonic77 adalah pilihan tepat bagi Anda yang menginginkan pengalaman bermain slot yang unggul dengan akun pro Swiss terbaik. Berikut adalah beberapa alasan mengapa Anda harus memilih Sonic77: Slot Gacor Terbaik Kami menyajikan koleksi slot gacor terbaik dari provider terkemuka. Dengan fitur-fitur unggulan dan peluang kemenangan yang tinggi, Anda akan merasakan pengalaman bermain yang tak terlupakan. Akun Pro Swiss Berkualitas Kami menawarkan akun pro Swiss yang berkualitas dan terpercaya. Dengan akun ini, Anda dapat menikmati berbagai keuntungan eksklusif dan fasilitas premium yang tidak tersedia untuk akun reguler.
    • SV388 SITUS RESMI SABUNG AYAM 2024   Temukan situs resmi untuk sabung ayam terpercaya di tahun 2024 dengan SV388! Dengan layanan terbaik dan pengalaman bertaruh yang tak tertandingi, SV388 adalah tempat terbaik untuk pecinta sabung ayam. Daftar sekarang untuk mengakses arena sabung ayam yang menarik dan nikmati kesempatan besar untuk meraih kemenangan. Jelajahi sensasi taruhan yang tak terlupakan di tahun ini dengan SV388! [[jumpuri:❱❱❱❱❱ DAFTAR DI SINI ❰❰❰❰❰ > https://w303.pink/orochimaru]] [[jumpuri:❱❱❱❱❱ DAFTAR DI SINI ❰❰❰❰❰ > https://w303.pink/orochimaru]]   JURAGANSLOT88 SITUS JUDI SLOT ONLINE TERPERCAYA 2024 Jelajahi pengalaman judi slot online terpercaya di tahun 2024 dengan JuraganSlot88! Sebagai salah satu situs terkemuka, JuraganSlot88 menawarkan berbagai pilihan permainan slot yang menarik dengan layanan terbaik dan keamanan yang terjamin. Daftar sekarang untuk mengakses sensasi taruhan yang tak terlupakan dan raih kesempatan besar untuk meraih kemenangan di tahun ini dengan JuraganSlot88 [[jumpuri:❱❱❱❱❱ DAFTAR DI SINI ❰❰❰❰❰ > https://w303.pink/orochimaru]] [[jumpuri:❱❱❱❱❱ DAFTAR DI SINI ❰❰❰❰❰ > https://w303.pink/orochimaru]]
    • Slot Bank MEGA atau Daftar slot Bank MEGA bisa anda lakukan pada situs WINNING303 kapanpun dan dimanapun, Bermodalkan Hp saja anda bisa mengakses chat ke agen kami selama 24 jam full. keuntungan bergabung bersama kami di WINNING303 adalah anda akan mendapatkan bonus 100% khusus member baru yang bergabung dan deposit. Tidak perlu banyak, 5 ribu rupiah saja anda sudah bisa bermain bersama kami di WINNING303 . Tunggu apa lagi ? Segera Klik DAFTAR dan anda akan jadi Jutawan dalam semalam.
    • ladangtoto situs resmi ladangtoto situs terpercaya 2024   Temukan situs resmi dan terpercaya untuk tahun 2024 di LadangToto! Dengan layanan terbaik dan keamanan yang terjamin, LadangToto adalah pilihan utama untuk penggemar judi online. Daftar sekarang untuk mengakses berbagai jenis permainan taruhan, termasuk togel, kasino, dan banyak lagi. Jelajahi sensasi taruhan yang tak terlupakan dan raih kesempatan besar untuk meraih kemenangan di tahun ini dengan LadangToto!" [[jumpuri:❱❱❱❱❱ DAFTAR DI SINI ❰❰❰❰❰ > https://w303.pink/orochimaru]] [[jumpuri:❱❱❱❱❱ DAFTAR DI SINI ❰❰❰❰❰ > https://w303.pink/orochimaru]]
  • Topics

×
×
  • Create New...

Important Information

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