Jump to content

Client side entity health


newboyhun

Recommended Posts

Client side health bars aren't 'impossible'.  But, as stated, they require sending custom packets from server-> every client tracking that entity. (I believe there is even a function in one of the network handlers that does exactly that).

 

I currently have client-side health bars for vehicles in my mod, using the above method.  (send health in initial IEntityAdditionalSpawnData(sp?) packet, and then send updates to all tracking clients every time health changes.)

 

Also there is a function IN the entities precisely for this use.  I think it is called something like handleHealthUpdate(byte data), which is called in world.setEntityState(Entity ent , byte data)  to send the packet to all players, without needing custom packets or handling.  If you look in the wolf or golem code, you can see how this method is used to internally update client-side statistics (health determines a wolf's tail angle, and the golems use it to determine if they should display a rose or not).

Link to comment
Share on other sites

Client side health bars aren't 'impossible'.  But, as stated, they require sending custom packets from server-> every client tracking that entity.

That's not client side. That's like saying unaided flight isn't impossible, you just need a plane.

 

'Client Side' health bars, meaning, no server mod required, is impossible.

Link to comment
Share on other sites

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

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.