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.

[Solved][1.14.4] Render a custom entity - the dreaded white cube

Featured Replies

Posted

I'm trying to make a new custom entity but I still get the white cube. Here's what I'm doing.

-I build my GrassmanModel by extending a BipedModel, and call the super constructor with the right parameters, as well as the super render.

-in the render (extending LivingRender) I super construct with EntityRendererManager as a param - in this class I also get the texture and create a render factory.

-In my client proxy during the FMLCommonSetupEvent, I render my entity rendering handler with parameters of my grassman entity class and a new grassman render factory.

-In my common registry events class I register my entity as I see fit.

-Also, in my Entity Init I of course initialize my grassman.

 

The texture is a renamed Zombie texture, with the exact pixels replaced with my grassman texture - its size is kept at 64x64 like what it's based on.

 

Still getting a white cube when I /summon. Why? I know this is a really complex issue, but I was hoping someone could help.

 

My code:

GrassmanModel

https://pastebin.com/qcYaS7UE

GrassmanEntity (kind of a mess in terms of AI but shouldn't affect the render)

https://pastebin.com/mvVtFevm

GrassmanRender

https://pastebin.com/LZsewnfb

InitEntity

https://pastebin.com/BpBxXJqk

ClientProxy

https://pastebin.com/3i8KaHzz

Main mod class

https://pastebin.com/frvi0DzF

Edited by Mojius

  • Author

Here's my RegistryEvents.java.

https://pastebin.com/j9RyDL8U

 

You're right - it calls for it to be loaded at a different time. I moved it to

private static void ForgeClientEvent(FMLClientSetupEvent event)
	{
        RenderingRegistry.registerEntityRenderingHandler(GrassmanEntity.class, new GrassmanRender.RenderFactory());
	}

in my main mod class. Still getting an error. And I know that's a terrible name for the method. Working it out as I go.

 

Also, I didn't see the first thing you said. I will try using side-specific event handlers.

Edited by Mojius

  • Author

I honestly cannot believe it was as simple as that. Yes, it renders now.

diesieben07, today I thank you. I'll work out the other rendering issues on my own.

 

You can mark this baby as SOLVED!

 

?

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.