Posted June 25, 201510 yr I want to turn the health system into numbers rather than hearts, for example 1000 HP instead of 10 hearts. How would I do this? Creator of the MyFit, MagiCraft, Tesseract gun, and Papa's Wingeria mod.
June 26, 201510 yr Subscribe to RenderGameOverlayEvent.Pre, check if the event.type is ElementType.HEALTH and cancel the event if it is. This will stop the hearts from being rendered. Then do your own rendering. http://i.imgur.com/NdrFdld.png[/img]
June 26, 201510 yr Author 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.
June 26, 201510 yr 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.
June 26, 201510 yr 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.
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.