ZDoctor Posted September 15, 2018 Posted September 15, 2018 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. Quote
V0idWa1k3r Posted September 15, 2018 Posted September 15, 2018 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. Quote
ZDoctor Posted September 16, 2018 Author Posted September 16, 2018 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. 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. Quote
Recommended Posts
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.