Jump to content

Recommended Posts

Posted

Hi There

Ive been trying to create a identical painting item to default minecraft to later modify with custom rendering. Currently I've made a copy of the Entity, Render and Item classes and registered them(See below). With this code how it is, The entity seems to spawn as it has the behaviour of a minecraft painting, ie - breaks off the wall if a block behind is removed, but has no hitbox and is not rendered. I have tried finding information on this topic but since a custom painting item is such a niche thing to need, I haven't had much luck. Im hoping its just a registration problem and a simple fix. Any suggestions are welcome!

 

EntityScreen:

  Reveal hidden contents

 

RenderScreen:

  Reveal hidden contents

 

ItemScreen:

  Reveal hidden contents

 

Renderer Registration in ClientProxy:

 RenderingRegistry.registerEntityRenderingHandler(EntityScreen.class, new RenderScreenFactory());

 

RenderScreenFactory:

public class RenderScreenFactory implements IRenderFactory<EntityScreen> {

	@Override
	public Render<? super EntityScreen> createRenderFor(RenderManager manager) {
		return new RenderScreen(manager);
	}

}

 

Entity Registration called in PreInit:

EntityRegistry.registerModEntity(new ResourceLocation("mcdj", "screenentity"), EntityScreen.class, "screenEntity", 0, MCDJMod.instance, 160, Integer.MAX_VALUE, false);		

 

If any more information is required, let me know.

Posted (edited)

Ive now moved to EntityEntryBuilder for entity registration, but as expected, it has not changed the situation.

The entity still doesn't have a bounding box or is rendered in any way but is being spawned.

 

New Entity registration code:

public static void registerEntity(RegistryEvent.Register<EntityEntry> reg){
		
		EntityEntry entityScreen = EntityEntryBuilder.create().entity(EntityScreen.class).id(new ResourceLocation(MCDJMod.modId, "screenentity"), 0).name("screenentity").tracker(160, Integer.MAX_VALUE, true).build();
		reg.getRegistry().register(entityScreen);
	
	}

 

 Any suggestions are appreciated.

Edited by TheMCJavaFre4k
Formatting
Posted

Please post your code as a GitHub repository. Hardcoding 0 as your ID isn’t the best idea. I recommend registering entity renders in the model registry event. 99% of the time you don’t need a proxy. 

About Me

  Reveal hidden contents

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

Posted
  On 3/5/2019 at 1:57 PM, Cadiboo said:

Please post your code as a GitHub repository. Hardcoding 0 as your ID isn’t the best idea. I recommend registering entity renders in the model registry event. 99% of the time you don’t need a proxy. 

Expand  

My repository if found here: https://bitbucket.org/TheMCJavaFre4k/mcdjmod/src/master/

Will probably swap to using a better ID system for my entities but just thought 0 would suffice for the single entity in testing.

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



×
×
  • Create New...

Important Information

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