Raffox97 Posted September 11, 2014 Posted September 11, 2014 Hi at all, i immediately explain my problem. I want to create an achievement that be triggered when I pick up a Lapis Lazuli, the problem is that the Lapis Lazuli is a dye and it create a problem with the mod that I'm making, because if i insert the code of the Lapis Lazuli the achievement don't be triggered but if i remove the metadata and I leave only the data of the ink sac, it working. Can anyone explain me that? Quote
Whov Posted September 11, 2014 Posted September 11, 2014 Could you show code if the above still doesn't help? Quote Check out my blog! http://www.whov.altervista.org
Raffox97 Posted September 11, 2014 Author Posted September 11, 2014 Here's the code: MineEvent/Pickup Event: public class MineEvent { @SubscribeEvent public void getMinedThings(PlayerEvent.ItemPickupEvent e){ if(e.pickedUp.getEntityItem().isItemEqual(new ItemStack(Items.dye, 1, 3))){ e.player.addStat(GenericMod.LapisLazuliAchievement, 1); } } } GenericMod class: @EventHandler public void load(FMLInitializationEvent event) { LapisLazuliAchievement = new Achievement("achievement.LapisLazuliAchievement", "LapisLazuliAchievement", 8, 4, new ItemStack(Items.dye, 1, 4), AchievementList.buildBetterPickaxe).registerStat(); FMLCommonHandler.instance().bus().register(new MineEvent()); proxy.registerRenderers(); } } I've taken away many thing as you see, but in the original class there are still here. Quote
Raffox97 Posted September 11, 2014 Author Posted September 11, 2014 Thanks, I'm a totally idiot. Quote
Recommended Posts
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.