Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

I'm having an interesting problem where a nameplate appears above my wyrmling mobs when they spawn and it says "Wyrmling" of course. I have no clue what I'm doing wrong. Has anyone had this problem before? What's the fix? I'll post my code later when I'm home.

  • Author
19 hours ago, diesieben07 said:

Your code would be needed, especially your renderer class.

Here is the EntityWyrmling Class:

Quote

public class EntityWyrmling extends EntityCaveSpider {

    public EntityWyrmling(World worldIn)
    {
        super(worldIn);
    }

    @Override
    protected SoundEvent getAmbientSound()
    {
        return SoundEvents.ENTITY_SILVERFISH_AMBIENT;
    }
    
    @Override
    protected SoundEvent getHurtSound(DamageSource damageSourceIn)
    {
        return SoundEvents.ENTITY_SILVERFISH_HURT;
    }
    
    @Override
    protected SoundEvent getDeathSound()
    {
        return SoundEvents.ENTITY_SILVERFISH_DEATH;
    }
    
    @Override
    protected void applyEntityAttributes()
    {
        super.applyEntityAttributes();
        this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.28D);
        this.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(16.0D);
        this.getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).setBaseValue(4.0D);
    }
    
    @Override
    public EnumCreatureAttribute getCreatureAttribute()
    {
        return EnumCreatureAttribute.ARTHROPOD;
    }
    
    @Override
    protected ResourceLocation getLootTable()
    {
        return LootTableHandler.ZOMBUG;
    }
}

and here is the render class:

Quote

public class RenderWyrmling extends RenderLivingBase<EntityWyrmling>{

    public static final ResourceLocation TEXTURES = new ResourceLocation(Reference.MOD_ID + ":textures/entity/wyrmling.png");
    
    public RenderWyrmling(RenderManager renderManagerIn)
    {
        super(renderManagerIn, new ModelWyrmling(), 0.5f);
    }
    
    @Override
    protected ResourceLocation getEntityTexture(EntityWyrmling entity)
    {
        return TEXTURES;
    }
    
    @Override
    protected void applyRotations(EntityWyrmling entityWyrmling, float p_77043_2_, float rotationYaw, float partialTicks) {
        super.applyRotations(entityWyrmling, p_77043_2_, rotationYaw, partialTicks);
    }
}

And if you need it, here is my init class for entities:

Quote

public class EntityInit {

    public static void registerEntities()
    {
        registerEntity("scaleton", EntityScaleton.class, Reference.ENTITY_SCALETON, 24, 8598175, 6346362);
        registerEntity("zombug", EntityZombug.class, Reference.ENTITY_ZOMBUG, 32, 8598175, 6346362);
        registerEntity("wyrmling", EntityWyrmling.class, Reference.ENTITY_WYRMLING, 24, 8598175, 6346362);
    }
    
    public static void registerEntity(String name, Class<? extends Entity> entity, int id, int range, int color1, int color2)
    {
        EntityRegistry.registerModEntity(new ResourceLocation(Reference.MOD_ID + ":" + name), entity, name, id, Main.instance, range, 1, true, color1, color2);
    }
}

And I call this in my main, like this:

Quote

@EventHandler
    public static void PreInit(FMLPreInitializationEvent event)
    {
        GameRegistry.registerWorldGenerator(new ModWorldGen(), 3);
        DimensionInit.registerDimensions();
        GameRegistry.registerWorldGenerator(new GenerateCustomStructures(), 3);
        BiomeInit.registerBiomes();
        EntityInit.registerEntities();
        RenderHandler.registerEntityRenders();
    }

And here is my register class for the renders:

Quote

public class RenderHandler {

    public static void registerEntityRenders()
    {
        RenderingRegistry.registerEntityRenderingHandler(EntityScaleton.class, new IRenderFactory<EntityScaleton>()
        {
            @Override
            @SideOnly(Side.CLIENT)
            public Render<? super EntityScaleton> createRenderFor(RenderManager manager)
            {
                return new RenderScaleton(manager);
            }
        });
        
        RenderingRegistry.registerEntityRenderingHandler(EntityZombug.class, new IRenderFactory<EntityZombug>()
        {
            @Override
            @SideOnly(Side.CLIENT)
            public Render<? super EntityZombug> createRenderFor(RenderManager manager)
            {
                return new RenderZombug(manager);
            }
        });
        
        RenderingRegistry.registerEntityRenderingHandler(EntityWyrmling.class, new IRenderFactory<EntityWyrmling>()
        {
            @Override
            @SideOnly(Side.CLIENT)
            public Render<? super EntityWyrmling> createRenderFor(RenderManager manager)
            {
                return new RenderWyrmling(manager);
            }
        });
    }
}

The most interesting part to me is that I have 3 mobs, and neither of the other two have this problem.

Edited by JonIsPatented

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.