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

Ive been trying to make a new sword in forge forever!! Ive tried everything! Nothing works, Im modding in 1.6.1 so keep that in mind. My mod will include alot of swords, possibly 150, so i dont wanna create a new tool material for each one, is there an item constructor i can add to my public static final Item code? Please help as I need this for my mod to work!!

This method appears to be what sets weapon damage now:

    public Multimap func_111205_h()
    {
        Multimap multimap = super.func_111205_h();
        multimap.put(SharedMonsterAttributes.field_111264_e.func_111108_a(), new AttributeModifier(field_111210_e, "Weapon modifier", (double)this.weaponDamage, 0));
        return multimap;
    }

  • Author

This method appears to be what sets weapon damage now:

    public Multimap func_111205_h()
    {
        Multimap multimap = super.func_111205_h();
        multimap.put(SharedMonsterAttributes.field_111264_e.func_111108_a(), new AttributeModifier(field_111210_e, "Weapon modifier", (double)this.weaponDamage, 0));
        return multimap;
    }

 

Where should i put this in my Mod_***** file?

The way I would do it is I would create just one class, and have the constructor be something like

 

public int whichSword
public Item Sword;

public ItemSwords(int par1, EnumToolMaterial par2EnumToolMaterial, int par3){
this.whichSword = par3
this.getSword(par3) = this.sword
super (par1, par2EnumToolMaterial)
}

 

You could then have getSword return which sword you wanted, and then make a method that sets the attributes of that sword based on what getSword returned.

 

As for that other method, it looks like it already exists, so you could just call it and say you want the sword to have that attribute.  You could copy it into your mod_XXX file and call it from there if you wanted.

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.