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

Hello.

 

I'd like to change the motionX, Y, Z of an Entity (NOT a LivingEntity) to 0 (or whatever value) when it's in Water.

 

There's no simple "EntityUpdate" event so I wondered what was the best way to do it.

Hook into WorldTickEvent (pick one phase) and change stuff with World#entityList (name varies, I don't remember).

 

This way you can "almost" replicate LivingUpdateEvent - difference is you can't cancel it and is happens in slightly different time frame (which might make it "different" when changing stuff such as entity's motions).

 

For more look where said event is called from. (you will probabyl want to use START phase).

1.7.10 is no longer supported by forge, you are on your own.

  • Author

Unfortunately it just mess up the block movement every tick, it's not the effect I'm looking for at all. I would basically like items to stay, in water, at the height I throw them. Avoid them to sink. Here the standard behavior happens between each triggering of the event so it sinks a bit, then goes back up a bit, etc and in the end the sinking wins.

All items or just yours? You can return custom EntityItem from Item class. Something like #getEntityItem and #hasCustomEntityItem (again - I don't remember naming).

 

Edit:

For all others you can do the same with EntityJoinWorldEvent detect and spawn your own custom EntityItem.

 

P.S: In future - start with what you said in last post, just state your end goal.

1.7.10 is no longer supported by forge, you are on your own.

  • Author

I needed this for all items.. *Sigh* I guess it seems I'll have to customize every single Item in Minecraft if I ever want to do that.

 

P.S: In future - start with what you said in last post, just state your end goal.

 

I often like to do generic things that can have lots of uses, but you're right I should have added a clear example.

 

 

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.