Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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?

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

  • Author

Sweet Lex, please direct me xD. 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? @_@

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.