Jump to content

Recommended Posts

Posted (edited)

Experimenting with multiparty entities, I ran into a problem. My part entity does not detect incoming damage. I was making my entities following the example of vanilla dragon, and I think I missed some important detail. I would be grateful for any hints.

 

So this is my Parent Entity class:

  Reveal hidden contents

and a Part Entity:

  Reveal hidden contents

 

Edited by TheOrangeInd
Posted

So, after researching how vanilla projectiles work, I found that when determining whether to hit the target, they request a list of entities using a method from the Level class (the method is called getEntities). So the fact is that in this method they directly check whether the entity is a vanilla Dragon and, if true, request its PartEntities. That is, this method cannot add custom PartEntities to the returned list as ordinary entities, since they do not exist in the world, but they are a logical continuation of the parent class. At the same time, the getEntities method does not ask the checked entity to check the isMultipartEntity (from IForgeEntity interface) and, accordingly, does not add entities returned by the getParts method to the list.

I still do not rule out the possibility that I misunderstand the principle of this system. But at the moment it seems to me that in the current version of Forge, the correct implementation of Multipart Entities in the way conceived by the API developers is not possible.
I will be glad if I'm wrong and someone will correct me.

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.