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

within the onCrafting method within a Crafting handler you can give the player an achievement for crafting somthing:

if (item.itemID == Item.compass.itemID) {
		player.addStat(ExtraAchievments.craftCompass, 1);
	}

I'm wondering how I do this with an item that has metadata/damage values.

Legend of Zelda Mod[updated September 20th to 3.1.1]

Extra Achievements(Minecraft 1.8!)[updated April 3rd to 2.3.0]

Fancy Cheeses[updated May 8th to 0.5.0]

I would do something like:

if ( item.itemID == Item.compass.itemID && item.meta == Item.compass.meta && item.getDamage() < item.getMaxDamage() ) {
player.addStat ( ExtraAchievments.craftCompass, 1 );
}

I am Mew. The Legendary Psychic. I behave oddly and am always playing practical jokes.

ย 

I have also found that I really love making extremely long and extremely but sometimes not so descriptive variables. Sort of like what I just did there xD

  • Author

I would do something like:

if ( item.itemID == Item.compass.itemID && item.meta == Item.compass.meta && item.getDamage() < item.getMaxDamage() ) {
player.addStat ( ExtraAchievments.craftCompass, 1 );
}

Thanks, but how would i do a specific damage value?

like in "new ItemStack(Item.compass, 1, 3)" the item has a damage value of 3.

how would i do something like that?

Legend of Zelda Mod[updated September 20th to 3.1.1]

Extra Achievements(Minecraft 1.8!)[updated April 3rd to 2.3.0]

Fancy Cheeses[updated May 8th to 0.5.0]

  • Author

also, "meta cannot be resolved or is not a field"

Legend of Zelda Mod[updated September 20th to 3.1.1]

Extra Achievements(Minecraft 1.8!)[updated April 3rd to 2.3.0]

Fancy Cheeses[updated May 8th to 0.5.0]

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.