Jump to content

Revamp the health system


Asweez

Recommended Posts

But doest the heart system run on 1-20? That would mean the only numbers being displayed are 50, 100, 150 etc. I don't want it to be multiples of 50

Creator of the MyFit, MagiCraft, Tesseract gun, and Papa's Wingeria mod.

Link to comment
Share on other sites

There are like 5 ways of touching this. Some of them were used in old days (pre 1.6), some are quite new.

 

You can: (listing most "sane", others are CoreMod-ASM and reflection)

1. Set health attribute of entity to something else on EntityJoinedWorldEvent. That "something else" has to be saved separately in IEEP.

2. Add modifiers to health.

3. Operate on floating point - health is nothing but float - you can make 20.0F be whatever you want. It's just a value. Problem lies rather in vanilla - I am not sure - it might be (almost sure) that vanilla trims float to int at some point (to make full numbers). If that is the case you can't really do anything with floats.

 

In any of those ways you will most certainly run into fact that you WILL have to alter whole damage system.

 

EDIT

Note that while modifiers are synchronized internally, no matter what you do with them - changing BASE value of attribute is NOT.

BASE value is set only only during constructing, if you decide to alter it - you will need to send packet to clients (all) about it. You will (probably) also need to send packet to all others that will "soon start to track" given entity #dynamicUpdates #startTrackingEvent

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

Link to comment
Share on other sites

Integer health is only used for the overlay. The health float is fully saved and maintained, due to weakness portions dropping unarmed damage below half of a heart.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

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.