Jump to content

[1.7.10] Custom EntityItem that float on water


Frag

Recommended Posts

Hi guys,

 

from what I understood, when you throw an item on the ground, the item becomes and EntityItem, which contains an ItemStack, which contains the item.

 

Here is what I want to achieve. I want to have a floating item in water, so it wont drop to the bottom of the ocean when you release it with Q. So I  thought about inheriting the EntityItem. Here is my question:

 

1. What method I should override in my item to instantiate my own FragEntityItem ? As funny as it sounds, it was not that obvious...

2. Something I could be missing?

 

Thanks guys...

 

Link to comment
Share on other sites

Having the entity floating is not really my issue since I already know how to do it ... but I do not know how to get my new FragEntityItem when the item is dropped (instead of the standard EntityItem) ...

 

Override

Item#hasCustomEntity

to return

true

and

Item#createEntity

to return a new instance of

FragEntityItem

at the same position as the

Entity

argument.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Link to comment
Share on other sites

Having the entity floating is not really my issue since I already know how to do it ... but I do not know how to get my new FragEntityItem when the item is dropped (instead of the standard EntityItem) ...

 

Override

Item#hasCustomEntity

to return

true

and

Item#createEntity

to return a new instance of

FragEntityItem

at the same position as the

Entity

argument.

 

Just looked at the code and your recommendation does seem right! I will try it out and let you know. Thanks Choonster!

Link to comment
Share on other sites

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.