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.

1.5 Killed Customized Item crafting with negative damge by zeroing Item damage!?

Featured Replies

Posted

I used this as an example to placed customized effects to item when crafting same Items but with difference recipes yielding different custom effects.

 

To be clear: I used Negative numbers for display purposes only (while in output slot). Using positive numbers makes the new items to appear damaged, while negative numbers do not.

 

Example: This allowed to placing a different enchant on the item while crafting the item in two ways.

GameRegistry.addShapelessRecipe(new ItemStack(mod_HarkenScythe.HSTalisman, 1, -1), new Object[]
	{
		new ItemStack(mod_HarkenScythe.HSTalisman), new ItemStack(mod_HarkenScythe.HSSoulVessel, 1, 20)
	});

 

GameRegistry.addShapelessRecipe(new ItemStack(mod_HarkenScythe.HSTalisman, 1, -2), new Object[]
	{
		new ItemStack(mod_HarkenScythe.HSTalisman), new ItemStack(mod_HarkenScythe.HSBloodVessel, 1, 40)
	});

 

 

However Mojang added this to the Itemstack Constructor.... D:

    public ItemStack(int par1, int par2, int par3)
    {
        this.stackSize = 0;
        this.itemFrame = null;
        this.itemID = par1;
        this.stackSize = par2;
        this.itemDamage = par3;

        if (this.itemDamage < 0)
        {
            this.itemDamage = 0;
        }
    }

 

if (this.itemDamage < 0)
        {
            this.itemDamage = 0;
        }

 

Is there a new way to get around this problem? or a possiblity to have Forge remove that bit of added code as a Pull Request?

  • 2 weeks later...

Hey, i think i've the same problem with my piece of code that works well in 1.4.7.

 

GameRegistry.addRecipe(new ItemStack(Item.swordWood), new Object[] {" Y ", " X ", "  ", 'X', new ItemStack(Item.swordWood, 1, -1), 'Y', Block.planks});

 

I'm using Forge 1.5.1-7.7.0.605.

 

Any ideas?

So enchant the item and put the enchanted item in the recipe?

ItemStack enchantedTalisman = new ItemStack(/* stuff goes here */);
/* enchant the item here */
GameRegistry.addRecipe(enchantedTalisman, /* recipe goes here */);

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.