Jump to content

OwnAgePau

Forge Modder
  • Posts

    217
  • Joined

  • Last visited

Everything posted by OwnAgePau

  1. Okay i have done some testing and registered the custom ForgeHookEvent.class. Whenever i now attack an entity it doesn't do anything, i wonder do i have to super.***method do anything in order to continue the usual stuff and just start coding an if() construction in order to find out whether or not the player is attacking with an enchanted sword with Frost on it. Also before i added the event class i tested out my little bit of code to see if the calcModifier stuff was working and it is. So on certain mobs my weapon now does more damage whenver it has my enchantment so i guess i got 1 part working. So what was that you were saying about NBTTag, i have not worked with it as in, created my own function that uses it. Although i have seen some of those methods and have a general idea of how they work.
  2. Well with the magic effet i mean the particles that come off a mob whenever you hit them with an enchantment. But as far as i'm concerned it doesn't give any extra damage. I also wanted to have my frost enchantment do give the entity a slow debuff. (i will post my enchantment code in here as an edit after i have started up my pc) Edit: package Mod_Ores.Enchantments; import Mod_Ores.EnumCreatureHelper; import Mod_Ores.EnumSoulCreatureAttribute; import net.minecraft.enchantment.Enchantment; import net.minecraft.enchantment.EnumEnchantmentType; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EnumCreatureAttribute; public class EnchantmentFrost extends Enchantment { /**EnchantmentFrost constructor * * @param par1id the effectId * @param par2weight the weight (rarity something) * @param par3enumenchantmenttype the enchantment type */ public EnchantmentFrost(int par1id, int par2weight, EnumEnchantmentType par3enumenchantmenttype) { super(par1id, par2weight, par3enumenchantmenttype); this.setName("Frost"); } public String getName() { return name; } /** * Calculates de (magic) damage done by the enchantment on a living entity based on level and entity passed. */ public float calcModifierLiving(int par1, EntityLivingBase par2EntityLivingBase) { return EnumCreatureHelper.getSoulCreatureAttribute() == EnumSoulCreatureAttribute.FROST ? (float)par1 * 2.5F : (float)par1 * 0.0F; } // I have made a custom Enum in order to give my mobs a certain attribute and if that attribute is a FROST more damage will be done, that was 1 of the 2 ideas. But i am not sure whether its working completely yet as i haven't tested it yet. /** * Returns the minimal value of enchantability needed on the enchantment level passed. */ @Override public int getMinEnchantability(int par1) { return 10 + 20 * (par1 - 1); } /** * Returns the maximum value of enchantability nedded on the enchantment level passed. */ @Override public int getMaxEnchantability(int par1) { return super.getMinEnchantability(par1) + 50; } /** * Returns the maximum level that the enchantment can have. */ @Override public int getMaxLevel() { return 4; } }
  3. Well i make a new folder to put the forge folder in, i extract the forge folder from the newest version zip. I run install.bat, after that i run decompile. Then it already recompiles and gives 100 errors. If i run recompile after it, same problem. I have my mcp folder located on the E: drive, i always had that there without any problems. I myself think that the problem came with the newest java version or something. As i had my project upgraded to 1.6.2 and added some cool stuff, then i tried recompiling and reobfuscating. That still worked without problems. Although when i tried to run minecraft it wouldn't run (it just crashed on startup) and i read on the internet that i had to install a newer java version. So i did, then minecraft ran fine again. However when i try to recompile now it gives me 100 errors in the minecraft source code around renderer.IconRegister. Which makes no sense as it is a fresh forge installation... I even tried it on my laptop. Which gave the same problem. So on my pc i have got the newest jdk and jre (1.7.0_025 or something like that it is) and jre 1.7. But on my laptop i have jre 1.7 and jdk 1.7.0_06.
  4. Sorry for double posting a bit, but the same problem happens to occur on my laptop... I am not sure what the problem is or if it could be forge related...
  5. Uhm i am not sure if it has anything to do with it, but uhm in EnchantmentHelper there are methods that read and write NBTTag. And my enchantment can already be obtained with crafting books and using an enchantment table. I also discovered that whenever i attack a mob the "magic damage effect" is being shown. Also i haven't done much with forge events and such (still) and i do understand what an event is and all, i just don't yet understand all about the forge related registrations around it. So just to see if i understood you correctly: I will make this method in a custom ForgeHookEvent class (or whatver i will call it) that will take care of the way i handle the effect that will occur whenever i hit a mob. So whenever something that code (or similar code) is being run it will execute the entityAttacked(args) method in my ForgeHookEvent.class. Am i right? And yes i do use Init and PreInit
  6. Oh well, i am sorry that my Englisch isn't my first language and that i happened to have sayd something that wasn't completely what i meant. I meant it more in a way like where would i place the code that would make the effect occur, like i want my enchantment to do an effect whenever it hits an entity, but i couldn't figure out where i would do that. I have seen that page indeed, but i still haven't quite gotten straightened out where i would place the effect of my sword. As far as i understand on this thread the guy describes to make a certain class which will use the LivingAttackEvent. So when would this method that is being used in this class be triggered?(called entityAttacked in the example). I understand that i would have to make such a class to hook my "effects" to an event, but i don't yet understand the mechanics behind it. Maybe i am just overthinking this right now (it is quite late for me right now).
  7. I have looked at the event, and i understand what it does. But now i still have no idea where i would call upon this event. Would i do this when i hit an entity? if so in what class would i do that.
  8. If it is working, then you have your answer . If not, then what is wrong?
  9. Indeed i don't That sounds like something i want to start looking at thanks a lot. I think i'v got it from here
  10. Hi there, I have been looking into the adding of enchantments and i have gotten my own enchantment "Frost Enchantment" to show up as an enchantment book, to work in an anvil and i have gotten it to be able to get the enchantment from an enchantment table. Now i was looking for the place where minecraft handles the effects of the enchantments. I looked at swords, EntityPlayer, Enchantments and more. But i haven't found much of something that looks like an enchantment effect. All i found was the stuff in EntityPlayer that refers to the EnchantmentHelper. I tired looking at tutorials, although i did find some. Most of them were Modloader tutorials and they were changing base files (which i am not going to do). Where would i add the enchantment effect? would i do that in sword onEntityHit() or whatever that method is called? (i don't have the source in front of my right now) Any help is appreciated, thanks.
  11. I still haven't gotten it to recompile. I have tried: - Deleting all the java on my pc, deleting forge and reinstalling both. - Gotten the newest version of Java, but the same problem persists. I have no idea what is causing the recompile of mcp to cause all these errors, while in eclipse theres none.
  12. then you haven't set the name correctly.
  13. Jeah i think thats the only option left to find an answer. Thanks for helping!
  14. Haha very funy... altough i know for sure its not my pc, neither is it eclipse. But what the real problem is 0.0, i really need some help on that one. too bad you can't help me.
  15. Well you could start of by having it just to swim around in water, and maybe you can make a custom AI so that the mob stays around the water's edge.
  16. OOh that can come in handy , altough i know some about debugging and how usefull it can be i always thought i had to learn more about it as i thought i was doing it wrong somehow. I remember having little java knowledge that now grew to basic+ java knowledge and next year ill be teached basic-advanced java on school so this "getting to know java" helped me a bit on the first steps. I always keep searching for tutorials, but its sometimes hard to find the correct term to search for.
  17. As far as i can understand from what you want, is that you want 1 block (that has 2 varieties) to drop different items according to their variety. And you want them to drop random quantities aswell? I have made a file which is used for about 20 different blocks and for everyblock it drops the right one, so i used: @Override public int idDropped(int par1, Random random, int par2) { return this.blockID { if you even wanted random quanities you could use this method: @Override public int quantityDropped(Random par1random) { return par1random.nextInt(5); }
  18. I navigated to the net.minecraft.client.renderer.texture folder and did the following: 1. I tried adding a new folder - worked. 2. I tried opening one of the java files listed in there - worked 3. I tried saving changes to one of the files i created in there - worked
  19. @ GotoLink well i get the same errors when i have forge freshly installed and run recompile/decompile. I have checked a little further on these recompiling errors and as far as i can find out, 50% of them is because there is a certain package missing. The other 50% is because it cannot find the IconRegister. As far as "missing packages" i have no idea why it can't find them, becuase i run forges install.bat and before that was all there had to be done. Now here comes the "fun" part. The package that it can't find is net.minecraft.client.renderer.texture, as i checked in my mcp\src\minecraft\net\minecraft\client\renderer\texture it was right there. I also checked in eclipse if i could find the package as an import so i tried to import net.minecraft.client.renderer.texture and it worked fine with no errors. Last but not least all the other errors seem to be around this IconRegister, it seems that it cannot find the IconRegister file or something like that. I have no clue why recompile thinks this is wrong or something, but in my eclipse i can run minecraft along with my mod fine without any errors. Are there any thoughts of how to fix this, because this really holds me back from releasing a next version of my mod.
  20. About the auto smelting pickaxe, i am not sure if you already gotten it working or gave up on it. But what if you checked wether it is being mined by that certain pickaxe before it drops the ingot/ore. So in your idDropped() method or whatever it is called you would have some checks to find out what broke the ore? and if it is the pickaxe drop the ingot else just drop the ore.
  21. I have tried reinstalling forge, and immidiately after installing i tried decompiling but that didn't work when it tried recompiling the source it gave the same 100 errors. It has nothing to do with eclipse, but i have no clue on what could fix it... i need some serious help here.
×
×
  • Create New...

Important Information

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