Posted September 12, 201312 yr 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]
September 12, 201312 yr 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
September 12, 201312 yr 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]
September 12, 201312 yr 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.