Crazy minecraft, on 14 September 2012 - 12:28 AM, said:
Perhaps you could edit there health so that it takes 3 hits with an iron sword, and 2 hits with a diamond sword to kill all enemy mobs? Also edit food like normal Minecraft?
= Questions for anyone who reads this
Don't care about the code if you'll just get confused
Do you know how many damages each of the weapons do? Because the PC MC says diamonds do 7 and irons do 6, so I can make all the hostiles' healths equal to 14, so we can have 2 for diamond and 3 for iron. However, the damage values might be different, but I am uploading one with all at 14 anyway. The creeper's normal PE health is 16. Please tell me how many hits it takes with all the weapons to normally kill a creeper, and then patch this mod: http://dl.dropbox.co...amond_3iron.mod and then tell me how many hits it takes
This one does not include the health optimizations. I will post another patch sometime that has food separately.
With the food...
The code looks like this (in assembly but I translated):
public void eat(int health)
int totHealth = getCurrentHealth() + health
int healthAfterHeal = Math.min(totHealth, 20) //20 is max
However, the way its written in assembly makes it hard to edit the values for healing in here (because modders can only add the same amount of code that they kill) without removing the health cap (that would be too boring).
Another thing that we can do is look in the code for pressing on the screen with food, and trying to edit stuff there. Can you also tell me how many hearts each of the foods heal in PE right now, so that I can search for some kind of pattern and change specific values?
Thanks for all of your kind words. I will try to make mods when I can, but I have school, so sometimes I might not be able to.
And also, its not really too hard to just edit values for mob health...
function looks like this
The number is easy to change, the only hard part is learning about the stuff.
Making the health always give a constant is a bit harder, but not as hard as the stuff other modders do.
What I did was instead of making totHealth = currentHealth() + health, I make it currentHealth() + constant. All I have to do for this is make MCPE's assembly code store a constant into a registry instead of loading a memory item (the parameter)
If anyone tries, they can make mods too!