Jump to content

Recommended Posts

Posted (edited)

Hello, currently I'm working on a Minecraft mod with forge 1.15.2.

 

I'm trying to create a custom ProjectileEntity (with custom texture),

but it is unclear what I need exactly and why I need it.

 

I could trial and error until it works,

but I rather understand how to properly create an entity so that I know what I am doing.

 

This is my current understanding of the requirements:

 

requirements for custom ProjectileEntity

  • custom item class     (CustomEnderPearlItem extends Item)
  • custom entity class  (CustomEnderPearlEntity extends ProjectileEntity)
  • override `createSpawnPacket` in entity (`NetworkHooks.getEntitySpawningPacket(this)`)
  • register item
  • custom entity type 
  • register entity type

 

Wat already works:

The custom item (CustomEnderPearlItem) shows up correctly and shoots a CustomEnderPearlEntity.

The constructor of this entity is being called and it also receives tick updates.

 

What doesn't work:

The thrown entity doesn't render properly, and the `onImpact` method is not being called when it hits something.

 

I'm specifically asking for an explanation of what I need (at the very minimum),

and why I need it.

 

Any help is appreciated

Edited by steveson
Custom entity now works
Posted

I had a little trouble connecting everything together, but I finally got it working.

 

I ended up using a SpriteRenderer and a custom EntityType, so my entity now renders properly.

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.