Posted August 26, 201213 yr Hiya, I am just about finished porting my "Asgard Shield" Mod to Forge and have ran into one last step. Are there any hooks I can use for this line of code I normally edit in the EntityPlayer.class "og.class" //Mod_shield par2 = mod_AsgardShield.calcDamage(par1DamageSource, par2, this); //end protected void damageEntity(DamageSource par1DamageSource, int par2) { if (!par1DamageSource.isUnblockable() && this.isBlocking()) { par2 = 1 + par2 >> 1; } //Mod_shield par2 = mod_AsgardShield.calcDamage(par1DamageSource, par2, this); //end par2 = this.applyArmorCalculations(par1DamageSource, par2); par2 = this.applyPotionDamageCalculations(par1DamageSource, par2); this.addExhaustion(par1DamageSource.getHungerDamage()); this.health -= par2; } If no hooks are around, then am I still able to modify the EntityPlayer.class or have to use Player API? http://i715.photobucket.com/albums/ww155/JadeKnightblazer/AsgardShieldBannermain.png[/img]
August 26, 201213 yr Personally I would do it as a potion effect or so. But you can do that with the asm library in forge.
August 26, 201213 yr Or, you know.. you could use the damn EntityLiving events... Or the custom armor hooks. Go look. I do Forge for free, however the servers to run it arn't free, so anything is appreciated. Consider supporting the team on Patreon
August 27, 201213 yr Author Sweet Lex, please direct me . I been looking for a nice wiki or just a class file with all the hooks in it. (Only way I learn coding is to dive into it @_@ ) I really wish to take full advantage of Forge and would like to learn what it can do. You gave me a starting point, but please more info. -Thanks in advance Looking through all the events, only one seems sorta what I am looking for is: @Cancelable public class LivingHurtEvent extends LivingEvent { public final DamageSource source; public int ammount; public LivingHurtEvent(EntityLiving entity, DamageSource source, int ammount) { super(entity); this.source = source; this.ammount = ammount; } } But forgive me, how would I use it? @_@ http://i715.photobucket.com/albums/ww155/JadeKnightblazer/AsgardShieldBannermain.png[/img]
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.