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.15] custom ProjectileEntity requirements

Featured Replies

Posted

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

  • Author

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

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.