Jump to content

[1.15.2] Rendering a new trident entity


ultra_reemun

Recommended Posts

Usually to render my thrown items, I use the code:

event.getRegistry().register(ENTITY_TYPE.setRegistryName(new ResourceLocation("combat", "entity name")));

 

I now however am trying to add another trident to the game.

This form of rendering does not work in this case, does anybody know how I would go about rendering a new trident?

Link to comment
Share on other sites

7 minutes ago, ultra_reemun said:

event.getRegistry().register(ENTITY_TYPE.setRegistryName(new ResourceLocation("combat", "entity name")));

This has nothing to do with rendering. This is registering your EntityType.

 

8 minutes ago, ultra_reemun said:

This form of rendering does not work in this case, does anybody know how I would go about rendering a new trident?

Please define "does not work". Nothing renders? A purple elephant in a minecart renders? Show what you have tried specifically where you register a RenderFactory for your entity.

  • Haha 1

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

1 minute ago, Animefan8888 said:

This has nothing to do with rendering. This is registering your EntityType.

 

Please define "does not work". Nothing renders? A purple elephant in a minecart renders? Show what you have tried specifically where you register a RenderFactory for your entity.

Apologies, I pasted the wrong code I'm an idiot...

RenderingRegistry.registerEntityRenderingHandler(ENTITY_TYPE,
				manager -> new SpriteRenderer<>(manager, Minecraft.getInstance().getItemRenderer()));

 

The issue is that when I use this for my trident I get the error:

Cannot infer type argument(s) for <T> registerEntityRenderingHandler(EntityType<T>, IRenderFactory<? super T>)

 

Apologies for not being specific enough.

Link to comment
Share on other sites

2 minutes ago, ultra_reemun said:

Thank you for your reply, I'll try and figure out how it works

What does ENTITY_TYPE equal? And why doesn't your SpriteRenderer have a generic IE SpriteRenderer<MyTridentEntity> instead of SpriteRenderer<>

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

11 minutes ago, Animefan8888 said:

What does ENTITY_TYPE equal? And why doesn't your SpriteRenderer have a generic IE SpriteRenderer<MyTridentEntity> instead of SpriteRenderer<>

	public static final EntityType<SpearIronEntity> ENTITY_TYPE = EntityType.Builder
			.<SpearIronEntity>create(SpearIronEntity::new, EntityClassification.MISC).size(0.5F, 0.5F)
			.build("combat:spear_iron_entity");

Apologies again, that's all setup here, which is copy pasted from minecraft's Trident code and then adapted to fit how I've been setting things up with my throwable items.

 

This above code works with my throwable items, based off of code from a snowball, however I don't quite know how the trident fully works yet and therefore don't know what to do about rendering it.

 

Thanks for all your help.

Edited by ultra_reemun
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



×
×
  • Create New...

Important Information

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