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

I would like to get the current active potion effects of a living entity that is not the player. Ideally, this would be on the client side only needing no assistance from the server using what is available.

 

As far as I can tell and from what I tested, with the exception of the player, when a potion effect is added to an entity it is not updated to the client. The color of the particles as I can tell are stored in the POTION_EFFECTS, but not what type of effect they are. That is why the particles still spawn even if the client does not know what active effects are on the entity.

 

Here is something interesting, I noticed that since the potion effects are written to the nbt, when the world is reloaded, if a potion effect was active, then the client becomes aware of that effect. However, that effect is not removed and remains in the active potion map until next reload.

As you've said yourself the client doesn't know of potion effects applied to an entity. You will need to send them to the client yourself. Probably you would compare the current effects to the effects active last tick and send the data to the client when there is a new effect added/old effect removed/effect changed.

  • Author

Yeah, I was afraid of that. I tried pushing a fix, but it wasn't well received due to how it affected the patch file. It's too bad, I was hoping there was another way besides my patch. I made a pretty cool damage indicator above anything living that would show the status icons and the hearts would render just like a player's (animated and everything). It's pretty cool.2018-09-14_13_23_35.thumb.png.7583d1f4cabf400bbee052f804474a7e.png

 

Now if I want it to work like that I would need to learn to edit the files, probably with asm, and even then it would only work like that in single player mod unless the server had the same mod. :( I guess it would be an interesting skill to have.

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.