Posted September 23, 20159 yr 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...
September 23, 20159 yr I think you should override moveEntity, and bounce off when it goes into the water. I. Stellarium for Minecraft: Configurable Universe for Minecraft! (WIP) II. Stellar Sky, Better Star Rendering&Sky Utility mod, had separated from Stellarium.
September 23, 20159 yr Author 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) ...
September 23, 20159 yr 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.
September 23, 20159 yr Author 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!
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.