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

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?

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.

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.

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

  • Author
9 minutes ago, Ugdhar said:

I believe the Trident uses an ItemStackTileEntityRenderer in package net.minecraft.client.renderer.tileentity;

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

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.

  • Author
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

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.