Jump to content

[1.10.2] [SOLVED] Difference between Entity and EntityLiving?


Recommended Posts

Posted (edited)

Hey!

When I code living events I find that there are two entity getter methods. The first is event#getEntity and the second is event#getEntityLiving.

I know this might sound silly, but what is the difference between the two usages?

Thanks!

Edited by Differentiation
Posted
40 minutes ago, diesieben07 said:

getEntity is inherited from EntityEvent into it's child classes. EntityLivingEvent adds getEntityLiving. They return the same object, but getEntityLiving has a more specific return type.

This could be solved more cleanly by just overriding getEntity and narrowing the return type, but it is not.

Thanks!

Solved.

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.