Posted November 1, 20168 yr Hello Guys, is there any way to give an entity more than 1024 health? even i give him more then 1024, the health stuck at 1024 getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(5000.0D);
November 1, 20168 yr Short answer: no. SharedMonsterAttributes.MAX_HEALTH is an instance of RangedAttribute with a minimum value of 0, and maximum of, as you can see, 1024. Long answer: You can probably hack your way and change the IAttribute, of this entity, through the use of Reflection, and replace the RangedAttribute with another one, with a higher max cap. Note: MAX_HEALTH , is a final field, and thus you will also need to reset this modifier. One warning though. Reflection isn't for the light-hearted. It can be quite difficult to get the hang of it. Also previously known as eAndPi. "Pi, is there a station coming up where we can board your train of thought?" -Kronnn Published Mods: Underworld Handy links: Vic_'s Forge events Own WIP Tutorials.
November 1, 20168 yr You can also make them regen health really fast making them way more tough. I've seen this done in Witchery Lilith regens like 10 hp every second. Disclaimer: I been told to keep my opinions to myself, to shut up and that I am spreading lies and misinformation or even that my methods are unorthodox and or too irregular. Here are my suggestions take it or leave it.
November 1, 20168 yr You could provide with another value - the number of health bars remaining. When it dies, subtract 1 from the remaining bar count and restore it to full health, unless the bar count is reduced to 0. For example, if an enemy has 2000 health, give it 1000 health and 2 health bars.
November 1, 20168 yr You could provide with another value - the number of health bars remaining. Whoops 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.
August 29, 20232 yr On 11/1/2016 at 4:06 AM, Matryoshika said: Short answer: no. SharedMonsterAttributes.MAX_HEALTH is an instance of RangedAttribute with a minimum value of 0, and maximum of, as you can see, 1024. Long answer: You can probably hack your way and change the IAttribute, of this entity, through the use of Reflection, and replace the RangedAttribute with another one, with a higher max cap. Note: MAX_HEALTH , is a final field, and thus you will also need to reset this modifier. One warning though. Reflection isn't for the light-hearted. It can be quite difficult to get the hang of it. Hey, was wondering, where could I find these data sets? Or is there already a mod to do this? Given that SSundee's insane craft series has him with a max HP of 100.000
September 6, 20232 yr Yes, you can, but not quite in this way, for this you can use CAPABILITIES https://docs.minecraftforge.net/en/1.19.x/datastorage/capabilities/ and on this basis rewrite the damage system here is an example https://github.com/andreybadrey/forge/blob/master/src/main/java/com/bodryak/gmod/variables/server/MDS.java https://github.com/andreybadrey/forge/blob/master/src/main/java/com/bodryak/gmod/event/LivingEntityHurt.java
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.