Posted January 19, 20196 yr Hey, so i created an Entity that extends Entity. I registered it correctly and I see the spawn egg and i can spawn it without any errors. The problem is when i render it, It does not render correctly. I always see the model next to the player and not where the entity is. (The render is registered correctly as well) I think i need to use some GL code but i really didnt see any explantion of this. Here is my render class: (I used boat textures just for testing purposes) package me.dejoker.broomstick.render; import me.dejoker.broomstick.entities.EntityBroomstick; import me.dejoker.broomstick.models.ModelBroomstick; import net.minecraft.client.model.ModelBase; import net.minecraft.client.renderer.entity.Render; import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.util.ResourceLocation; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) public class RenderBroomstick extends Render<EntityBroomstick> { private static final ResourceLocation BOAT_TEXTURES = new ResourceLocation("textures/entity/boat/boat_oak.png"); ModelBase modelBroom = new ModelBroomstick(); protected RenderBroomstick(RenderManager renderManager) { super(renderManager); } @Override public void doRender(EntityBroomstick entity, double x, double y, double z, float entityYaw, float partialTicks) { modelBroom.render(entity, 0f, 0f, -0.1f, 0f, 0f, 0.0625f); super.doRender(entity, x, y, z, entityYaw, partialTicks); } @Override protected ResourceLocation getEntityTexture(EntityBroomstick entity) { return BOAT_TEXTURES; } } Edited January 20, 20196 yr by De Joker
January 19, 20196 yr Author 33 minutes ago, diesieben07 said: You need to use GLStateManager.translate(x, y, z) before rendering the model. And you need to pushMatrix before and popMatrix after, to return the matrix to it's original state afterwards. Thanks! That did work. Another thing I might ask is why when i extend EntityLiving the model register correctly and when i extend Entityit does not? Edited January 19, 20196 yr by De Joker
January 19, 20196 yr Author 3 hours ago, diesieben07 said: Define "model register correctly". I can see my model when it extends EntityLiving. And when it extends Entity I do not see the model rendering at all
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.