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

My custom entities are sometimes rendered correctly, but most of the time invisible. By this I mean: I can see them, they wander a bit, they are invisble and eventually they reappear. Im am sure that they're are still there in the meantime, because they still make sounds and some of my mobs which have AI to attack each other still do so and hence drop items.

 

That is what I call in preInit of my ClientProxy:

        RenderingRegistry.registerEntityRenderingHandler(EntityGargoyle.class, new EntityGargoyleRF());

 

That's the implementation of IRenderFactory:

 

Spoiler

package anagkai.biodiversity.entities.renderer;

import anagkai.biodiversity.entities.EntityGargoyle;
import anagkai.biodiversity.entities.models.ModelGargoyle;
import net.minecraft.client.renderer.entity.Render;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraftforge.fml.client.registry.IRenderFactory;

public class EntityGargoyleRF implements IRenderFactory<EntityGargoyle>{

	@Override
	public RenderGargoyle createRenderFor(RenderManager manager) {
		return new RenderGargoyle(manager, new ModelGargoyle(), 1F);
	}

}

 

That's my render class:

Spoiler

package anagkai.biodiversity.entities.renderer;

import anagkai.biodiversity.entities.models.ModelAnt;
import anagkai.biodiversity.entities.models.ModelGargoyle;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.entity.RenderLiving;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.entity.Entity;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

@SideOnly(Side.CLIENT)
public class RenderGargoyle extends RenderLiving {
public RenderGargoyle(RenderManager manager, ModelGargoyle model, float size) {
super(manager, model, size);
}
@Override
protected ResourceLocation getEntityTexture(Entity entity) {
return new ResourceLocation("biodiversity:textures/gargoyle.png");
}
}

 

 

The only problem is that the entities are often invisible. When they aren't they're rendered correctly with model and texture.

 

Any help is appreciated.

 

EDIT: Strangely, I can "trap" the invisible entities in small holes so they become visible again or when I spawn them in a small hole they stay visible for a longer time.

 

Edited by Anagkai

  • Author

That is in a separate class for my entities, the static method inside is called in preInit of my main mode file.

 

		EntityRegistry.registerModEntity(EntityGargoyle.class, "biodiversityGargoyle", 0, Biodiversity.MODID, 1, 1, true, 0x262626, 0x666666);

 

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.