Started by
Puro
on
Topic category: Help with Minecraft modding (Java Edition)
Making a mod for a map I'm making, and this is the main reason I'm doing it, I've tried to set the health to over 1024 in the Creator and just doesn't work, is there anyway to get around this? Or is this just a thing thats just kinda there forever.
*PS- Absorption effect and Armor sadly don't make the cut due to the number I am using, like end-game bosses with 50k HP.
Create your entity, ste all the desired values and procedures and save.Now go to your_awesome_model.java (in your mods entity folder), look for ...
Note ... If you unlock the code, that value will reset to default.
that doesnt seem to of worked, the health is still 1024, check by using the /data command
I used the health boost effect to get my mob up to 6,000 hp.
You'd need to use AttributeFix to increase the cap, and then edit the value directly the code just as __SK__ said.
You can add AttributeFix as a dependency on Settings - External APIs
Ah, yh, that mid has now decided to work, though I don't see how to add it as a dependency in External APIs
Just put the modid in the additional requiered mods part, I think it's "attributesfix" but you can check by going to your mods tab ingame
You can just add absorption effect when it spawns. Absorption is stored a bit differently to regular health, so if you do when entity spawns, give entity absorption 1000, you can go past 1024 hp easily. The max hp with absorption is in the billions.
add a false hp bar
whenever mob is with not max hp. the false hp depletes and heals the leftover hp to the mob
and in entity dies make it cancel if still have some of that false hp leftover (cancelling global trigger)
global hp = number nbt . set on spawn
or. you can either if is a boss add a little multiple phases style!
healing it whenever is with X amount of hp. and the total hp of what it heals is basically the true hp
Absorption effect can still get you to 50k hp, the limit is like in the billions. With Mcreator, you can go past absorption 255, which is the good thing. So for example, if you want 50k hp, then just add absorption 12500 for 999999 ticks when the boss spawns. The limit is in the billions, and if you wanna go even further, there's one last way: variables. It's ridiculously advanced script though, so I'll explain it in the next comment.
Ok, so here's the extremely advanced script:
So first, make a new variable called "HP of custom boss" or something like that. If the hp is somewhere less than 2 billion or so, then you can just set this variable to the total number of hp you want your custom boss to have. And then when your boss spawns, you have to set the hp variable to whatever. When the boss is hit, it'll do another procedure. In that procedure, make a new local variable and name it "damage dealt". This is another number variable. Set it to 0 to start with. Now, if the player has a wooden sword in his/her mainhand, change the variable by 4. If they have a stone sword, change it by 5... And so on. So just tons of "if" blocks, that change the damage dealt. Finally, depending on the player's strength effect, also change the local variable. Now, you should have the total damage that was dealt to the boss, and you decrease the hp of custom boss variable by your local damage dealt variable. If the custom boss hp variable is less than 0.01, then you kill the boss.
But, what if you wanted something much bigger? Like, clicker heroes level hp? I mean, we're talking googol, or 1.000e1000 and stuff. Well, simple. Make two variables: Custom boss hp, and custom boss hp digit count. The first variable defines the first few digits of the hp, and the second variable is the number of digits in the hp. For example, if you wanted a boss with googol hp, then the custom boss hp variable would be 1, and the custom boss hp digit count variable would be 100, or something like 1.000e100. When your custom boss spawns, it'll just reset all those variables. Next, is the annoying part. hen the boss is hit, it'll do another procedure. In that procedure, make a new local variable and name it "damage dealt". This is another number variable. Set it to 0 to start with. Now, if the player has a wooden sword in his/her mainhand, change the variable by 4. If they have a stone sword, change it by 5... And so on. So just tons of "if" blocks, that change the damage dealt. Finally, depending on the player's strength effect, also change the local variable. Now, you should have the total damage that was dealt to the boss. Finally, you just set the local variable to "Total damage dealt local variable" divided by "custom boss hp digit count". And you decrease the hp of custom boss variable by your local damage dealt variable. But, if, for example, the boss has googol hp and you have a weapon that can deal googol/10 damage, then you may as well just put into the code: Set "custom boss hp" to "custom boss hp - 0.1" or something like that, to make it run faster. If the custom boss hp variable is less than 0.01, then you kill the boss.
If the second part is confusing, just stick with the first part or absorption, those work fine anyway.