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.

Featured Replies

Posted

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

 

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.

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

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.

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

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.