Jump to content

PlayPrey

Members
  • Posts

    39
  • Joined

  • Last visited

Everything posted by PlayPrey

  1. Hello once again; Sorry for asking so many questions in a short period of time. I have managed to get my mod to detect when something is smelted, however; I can't figure out how to do it with for example charcoal, or cactus green. I tried (prepare to facepalm!) if (e.smelting.getItem() == new ItemStack(Items.coal,1)) { player.addStat(AE.burnFuel_to_receiveFuel, 1); } The error is [incompatible operand types Item and ItemStack]
  2. Thank you! The game now gives the achievement and outputs the text! Just wondering though, why does the message appear at a random amount? Sometimes I get the message 4 times, sometimes 2, others 5 and so on... If I were to try and count the amount of times something has been smelted, I would get a completely wrong resoult. (int bakedPotatos; (inside method) bakedPotatos += 1; ) If I did that It would get more than just one.
  3. Hehe sorry; Dont know why I tried equals. Here's the up to date code: (Not including the proxy classes) Main.java http://pastebin.com/9PCZ05hS CraftingHandler.java http://pastebin.com/qz4RKLx7 Additional notes; -Yes the achievement is being registered. -The other handler's (found in main.java) work fine for what I use them for.
  4. Hmm, just noticed that some code didnt get pasted. So I got; @SubscribeEvent public void onSmelt(PlayerEvent.ItemSmeltedEvent e) { EntityPlayer player = (EntityPlayer) e.player; player.addChatMessage(new ChatComponentText("TYETJOASD")); if (e.smelting.equals(Items.baked_potato)) { player.addStat(AE.bakePotato 1); } } But the achievement is still not unlocking, neither am I getting the chat message. What am I missing here? (Also; I do know basic Java, but it has been 3 years since I programmed with Java, so things go about slowly. Also; Forge was diffrent back then.. Very diffrent , Nothing of my old code was usable.. ) So I am sorry for the stupid questions; I really am. But how do I compare with the event, and an Item? (Also x2: I know what == does, it compares 2 values to see if theyre the same... right? )
  5. Hello, this is something I could do fine (3 years ago)... Now I returned and see that this is completely diffrent. How do I check if the player has smelted or crafted an item? I tried: public class CraftingHandler (Usually I could implement CraftingHandler, however its now gone??? ) { @SubscribeEvent public void onSmelt(EntityPlayer player, ItemStack item) { if (item == new ItemStack(Items.baked_potato)) { player.addStat(AE.bakePotato, 1); } } } I am sorry for all the stupid questions, but it has been a long time since I modded Minecraft, I lost almost all the knowledge I had
  6. Thank you!! That extra instanceof check fixed the problem!
  7. Hello, I am making a achievement mod, and my mod tracks the deaths of entities. I wanted to be able to release a version today, but that is not happening with this bug. Crash Report: http://pastebin.com/WJ0UXPHj I am not trying to cast EntityWolf to Player on purpose, I think its being casted when the wolf kills a rabbit, why it casts to the player confuses me. Code used: (imports lots of stuff) public class SlayHandler { @SubscribeEvent public void KillEntity(LivingDeathEvent event) { EntityPlayer player = (EntityPlayer) event.source.getSourceOfDamage(); } }
  8. Thank you, I think I almost have it now I tried doing ".readStat(StatList.mobKillsStat)" and ".readStat(StatList.timeSinceDeathStat)" however they all seem to return the value 0. Even though I have killed mobs, and I have survived longer than 0 seconds.. Also, do you know how to define what mobs I want to look for in "mobKillsStat"?
  9. It's filled with field_146546_t and func_148210_b and also p_148129_1_ values. I don't know how to use them to get the value I want.
  10. Thank you; I did find that StatList might work, I tried to do something like; public int blahblah; (in a void) blahblah = StatList.damageDealtStat; However, now "blahblah" has to become a StatBase for the new value to be applied, but then I cannot check blahblah as if it was an int "if(blahblah == 4)" Am I missing something?
  11. The numbers and words tell you why it didn't work, if you don't understand them, post them here.
  12. @Failender ; Yes, I want to access the vanilla statistics to track certain things, but I have no clue what method to use for that, could you aid me?
  13. Hello, I was wondering if it was possible to check a statistic from the client side player? For example, distance walked or amount of creepers killed.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.