Jump to content

Invisible Custom Mob 1.11


XavierEmeralds

Recommended Posts

So I'm working on making a penguin in Minecraft as practice, and I have the animations and .png and model and everything finished, except when I boot it up they're invisible.  I can see their shadows but not them. However, when I hit them they show up briefly and in red. Any help? Here are my Render

Spoiler

 

package xavier.welsanimals.init.mobs.renderers;

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;
import xavier.welsanimals.init.mobs.entities.EntityPenguin;
import xavier.welsanimals.main.Reference;

public class RenderPenguin extends RenderLiving<EntityPenguin>
{
    public static final ResourceLocation PENGUIN_TEXTURE = new ResourceLocation(Reference.MODID, "textures/entity/penguin/penguin.png");
    
    public RenderPenguin(RenderManager rendermanagerIn, ModelBase modelbaseIn, float shadowsizeIn) 
    {
        super(rendermanagerIn, modelbaseIn, shadowsizeIn);
    }
    
    protected ResourceLocation getEntityTexture(EntityPenguin entity)
    {
        return PENGUIN_TEXTURE;
    }
    
}

 

 


 

 and Model files

Spoiler

 

package xavier.welsanimals.init.mobs.models;

import org.lwjgl.opengl.GL11;

import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.Entity;
import net.minecraft.util.math.MathHelper;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

/**
 * Penguin by XavierEmeralds
 */
@SideOnly(Side.CLIENT)
public class ModelPenguin extends ModelBase {
    public ModelRenderer Body;
    public ModelRenderer Body1;
    public ModelRenderer Body2;
    public ModelRenderer Leg1;
    public ModelRenderer Foot1;
    public ModelRenderer Leg2;
    public ModelRenderer Foot2;
    public ModelRenderer Arm1;
    public ModelRenderer Arm11;
    public ModelRenderer Arm2;
    public ModelRenderer Arm22;
    public ModelRenderer Head;
    public ModelRenderer Beak;

    public ModelPenguin(float scale) 
    {
        this.textureWidth = 64;
        this.textureHeight = 32;

        this.Body = new ModelRenderer(this, 16, 0);
        this.Body.setRotationPoint(0.0F, 9.0F, 0.0F);
        this.Body.addBox(-3.0F, 0.0F, -2.0F, 6, 12, 4);
        this.Body1 = new ModelRenderer(this, 0, 12);
        this.Body1.setRotationPoint(0.0F, 0.0F, 0.0F);
        this.Body1.addBox(-2.5F, -0.5F, -1.5F, 5, 1, 3);
        this.Body.addChild(this.Body1);
        this.Body2 = new ModelRenderer(this, 0, 12);
        this.Body2.setRotationPoint(0.0F, 0.0F, 0.0F);
        this.Body2.addBox(-2.5F, 11.5F, -1.5F, 5, 1, 3);
        this.Body.addChild(this.Body2);
        this.Leg1 = new ModelRenderer(this, 0, 5);
        this.Leg1.setRotationPoint(1.0F, 21.5F, 0.0F);
        this.Leg1.addBox(-0.2F, -0.5F, -0.5F, 1, 2, 1);
        this.Foot1 = new ModelRenderer(this, 0, 0);
        this.Foot1.setRotationPoint(0.0F, 0.0F, 0.0F);
        this.Foot1.addBox(-0.7F, 1.5F, -2.0F, 2, 1, 3);
        this.Leg1.addChild(this.Foot1);
        this.Leg2 = new ModelRenderer(this, 0, 5);
        this.Leg2.setRotationPoint(-1.0F, 21.5F, 0.0F);
        this.Leg2.addBox(-1.0F, -0.5F, -0.5F, 1, 2, 1);
        this.Foot2 = new ModelRenderer(this, 0, 0);
        this.Foot2.setRotationPoint(0.0F, 0.0F, 0.0F);
        this.Foot2.addBox(-1.5F, 1.5F, -2.0F, 2, 1, 3);
        this.Leg2.addChild(this.Foot2);
        this.Arm1 = new ModelRenderer(this, 44, 6);
        this.Arm1.setRotationPoint(-3.0F, 10.5F, 0.0F);
        this.Arm1.addBox(-1.0F, 0.0F, -1.5F, 1, 7, 3);
        this.Arm11 = new ModelRenderer(this, 42, 16);
        this.Arm11.setRotationPoint(0.0F, 0.0F, 0.0F);
        this.Arm11.addBox(-1.0F, 7.0F, -1.0F, 1, 1, 2);
        this.Arm1.addChild(this.Arm11);
        this.Arm2 = new ModelRenderer(this, 36, 6);
        this.Arm2.setRotationPoint(3.0F, 10.5F, 0.0F);
        this.Arm2.addBox(0.0F, 0.0F, -1.5F, 1, 7, 3);
        this.Arm22 = new ModelRenderer(this, 34, 16);
        this.Arm22.setRotationPoint(0.0F, 0.0F, 0.0F);
        this.Arm22.addBox(0.0F, 7.0F, -1.0F, 1, 1, 2);
        this.Arm2.addChild(this.Arm22);
        this.Head = new ModelRenderer(this, 36, 0);
        this.Head.setRotationPoint(0.0F, 9.0F, 0.0F);
        this.Head.addBox(-1.5F, -3.5F, -1.5F, 3, 3, 3);
        this.Beak = new ModelRenderer(this, 0, 9);
        this.Beak.setRotationPoint(0.0F, 0.0F, 0.0F);
        this.Beak.addBox(-1.0F, -1.7F, -2.5F, 2, 1, 1);
        this.Head.addChild(this.Beak);
    }

    public void render(Entity entity, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor) 
    {
        super.render(entity, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scaleFactor);
        setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scaleFactor, entity);
        
        GlStateManager.enableBlend();
        GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
        GlStateManager.color(1.0F, 1.0F, 1.0F, 0.0F);
        this.Body.render(scaleFactor);
        GlStateManager.disableBlend();
        GlStateManager.enableBlend();
        GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
        GlStateManager.color(1.0F, 1.0F, 1.0F, 0.0F);
        this.Leg1.render(scaleFactor);
        GlStateManager.disableBlend();
        GlStateManager.enableBlend();
        GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
        GlStateManager.color(1.0F, 1.0F, 1.0F, 0.0F);
        this.Leg2.render(scaleFactor);
        GlStateManager.disableBlend();
        GlStateManager.enableBlend();
        GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
        GlStateManager.color(1.0F, 1.0F, 1.0F, 0.0F);
        this.Arm1.render(scaleFactor);
        GlStateManager.disableBlend();
        GlStateManager.enableBlend();
        GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
        GlStateManager.color(1.0F, 1.0F, 1.0F, 0.0F);
        this.Arm2.render(scaleFactor);
        GlStateManager.disableBlend();
        GlStateManager.enableBlend();
        GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
        GlStateManager.color(1.0F, 1.0F, 1.0F, 0.0F);
        this.Head.render(scaleFactor);
        GlStateManager.disableBlend();
    }

    public void setRotation(ModelRenderer modelRenderer, float x, float y, float z) 
    {
        modelRenderer.rotateAngleX = x;
        modelRenderer.rotateAngleY = y;
        modelRenderer.rotateAngleZ = z;
    }
    
    public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entity)
    {
        float XAngle = headPitch / 57.29578F;
        float YAngle = netHeadYaw / 57.29578F;
        
        this.Head.rotateAngleX = (0.2617794F + XAngle);
        this.Head.rotateAngleY = (YAngle);
        
        this.Leg1.rotateAngleX = MathHelper.cos(limbSwing * 0.6662F) * 1.4F * limbSwingAmount;
        this.Leg2.rotateAngleX = MathHelper.cos(limbSwing * 0.6662F + (float)Math.PI) * 1.4F * limbSwingAmount;
        
        this.Arm1.rotateAngleX = MathHelper.cos(limbSwing * 0.0662F) * 1.4F * limbSwingAmount;
        this.Arm2.rotateAngleX = MathHelper.cos(limbSwing * 0.0662F +(float)Math.PI) * 1.4F * limbSwingAmount;
    }
    
}

 

 


 

2017-03-31_11.57.30.png

2017-03-31_11.50.23.png

Link to comment
Share on other sites

Same Issue... been trying to find the reason however I wasn't very successful with that :(

Entity Class:

https://github.com/DarkRoleplay/Dark-Roleplay-Medieval/blob/1.11/src/main/java/net/drpmedieval/common/entities/fox/Entity_Fox.java

Renderer and Model:

https://github.com/DarkRoleplay/Dark-Roleplay-Medieval/tree/1.11/src/main/java/net/drpmedieval/client/entities/fox

 

Registry is correct unless something changed with 1.11.

I would appreciate any help and Thanks in advance!

Link to comment
Share on other sites

Solved it, however I have to figure out why as I am still new to Entities and never made a real one :P

Spoiler

    @Override
    public void render(Entity entity, float limbSwing, float limbSwingAmount, float ageInTicks, float rotationYaw, float rotationPitch, float scale) {
        super.render(entity, limbSwing, limbSwingAmount, ageInTicks, rotationYaw, rotationPitch, scale);
        setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, rotationYaw, rotationPitch, scale, entity);
           GlStateManager.enableBlend();
           GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
           GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
        this.BodyCenter.render(scale);
           GlStateManager.disableBlend();
        
    }

Edit: Well it seems the modeling Software (Qubble) sets just the Alpha value to 0 in the following line:

GlStateManager.color :P Chaning the 0 to 1 fixes it. 

Edited by JTK222
  • Like 1
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

    • Right now im trying to make an own mod for minecraft for the version 1.16.5 with forge but whatever i do it still doesnt fix the error this is my build.gradle : buildscript { repositories { maven { url = "https://maven.minecraftforge.net" } mavenCentral() } dependencies { classpath 'net.minecraftforge.gradle:ForgeGradle:5.1.+' } } apply plugin: 'net.minecraftforge.gradle' apply plugin: 'java' group = 'com.example' // Modify to your package name version = '1.0' archivesBaseName = 'flippermod' java { toolchain { languageVersion = JavaLanguageVersion.of(8) } } minecraft { version = "1.16.5-36.2.42" // Ensure this matches your Forge version mappings channel: 'official', version: '1.16.5' runs { client { workingDirectory project.file('run') property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP' property 'forge.logging.console.level', 'debug' mods { flipper_mod { sourceSets.main.output } } } } } repositories { maven { url = "https://maven.minecraftforge.net/" } mavenCentral() } dependencies { minecraft "net.minecraftforge:forge:1.16.5-36.2.42" } and this one is my settings.gradle:  pluginManagement { repositories { gradlePluginPortal() maven { name = 'MinecraftForge' url = 'https://maven.minecraftforge.net/' } } } plugins { id 'org.gradle.toolchains.foojay-resolver-convention' version '0.7.0' } rootProject.name = 'flippermod' this one is the mods.tml    modLoader="javafml" loaderVersion="[36,)" modId="flippermod" version="1.0.0" displayName="Flippermod" and the last one is the gradle-wrapper.properties distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip dc :"code_slivki"
    • Today I tried downloading 1.16.5 forge (the recommended version) and when installing I selected "download client". At the end just before appeared "These libraries failed to download. Try again." and at the bottom there were "org.apache.logging.log4j:log4j-api:2.15.0 ; org.apache.logging.log4j:log4j-core:2.15.0 and org.apache.logging.log4j:log4j-slf4j18-impl2.15.0" I tried the newest version and the same thing appeared
    • I think the problem is the server doesn't have enough ram, but I need to be sure before buying more. The modpack I use is Craft of exile 2 and the server has 4gb ram. When I try to turn it on I get a bunch of warns and at the end it just says "[Multicraft] Skipped 564 lines due to rate limit (160/s)" Is there a way to increase the rate limit? One time it did start, but without half of the mods. The modpack works perfectly fine on my computer even if I have the launch ram limit to 4gb.
    • Nevermind, RedstoneWireBlock.java had what I needed. Surprised I didn't try looking there until now.
    • I tried to open my Minecraft world normally and got the error "Errors in currently selected data pacts prevented the world from loading." Trying to start in safe mode gives the error "This world contains invalid or corrupted save data." My recent log is too large to make a Pastebin link. Any help would be much appreciated. 
  • Topics

×
×
  • Create New...

Important Information

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