Jump to content

graywolf69

Members
  • Posts

    9
  • Joined

  • Last visited

Everything posted by graywolf69

  1. Nevermind, I thought about it and wrote some code that should work, but doesn't. I basically made a new boolean in my bow class called explosive and set it to false. Then I told it to check if there was my enchantment on the bow, and if so, set explosive to true. Then, in my arrow entity, I told it to check if explosive was set to true, and if so, explode when it hits the ground. If it isn't true it is supposed to act like a normal arrow. My problem is that even when the bow doesn't have my enchantment, the arrow explodes. Can anyone tell me what I am doing wrong? Here is my custom arrow: http://pastebin.com/FDLLh5GM Here is my bow class: http://pastebin.com/3AEd1wsj And here is my main registry class where I register the enchantment: http://pastebin.com/XwWLbcv4 Tell me if you need more code than this, Thank you for any help provided!
  2. I made a custom bow, with its own custom arrow and arrow entity. I made an enchantment that can be put on any bow, and I know a way to make my custom arrow explode (in the custom arrow entity class). I have see in the bow class that it tests for enchantments there, and if it has an enchantment like power it will tell the EntityArrow.class to make it damage more. Is there a way I can check if it has my enchantment, and then if it does change this: if (this.inGround) { int j = this.worldObj.getBlockMetadata(this.field_145791_d, this.field_145792_e, this.field_145789_f); if (block == this.field_145790_g && j == this.inData) { ++this.ticksInGround; if (this.ticksInGround == 1200) //set to 1 for explosion { this.setDead(); //this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, 5.0F, true); } } else { this.inGround = false; this.motionX *= (double)(this.rand.nextFloat() * 0.2F); this.motionY *= (double)(this.rand.nextFloat() * 0.2F); this.motionZ *= (double)(this.rand.nextFloat() * 0.2F); this.ticksInGround = 0; this.ticksInAir = 0; } to the parameters needed to make the arrow explode? Thank you for your help, I am new to modding!
  3. This sounds perfect! Can you tell me where I set the weight? Thank you!
  4. Thank you, it works (sort of)! one problem after another in modding. I found the structure... well, bits of the roof at least. It spawns submerged in the ground, and also the ground overrides the structure (as in, the structure is generated, and then the ground is generated, replacing the structure). Is there something I can add to my code to make it only spawn on top of the ground, and also a way to make it generate after the ground (i.e. if it needed to, it would replace the ground instead of the ground replacing it). Thank you for your help so far!!!
  5. I'm guessing you meant if(random.nextInt(100) < 1)
  6. Yes, makes sense! Ill give it a try.
  7. Im new to modding and yes, to me it does seem like the same thing, but I am sure that my method works. Give it a try.
  8. I have a structure I made that only spawns in plains biome. If your dimension only uses your custom biomes, you can make it so your structure doesn't spawn in any other dimension as long as your custom biomes don't spawn in other dimensions. Put this around all of your world.setBlock parts: BiomeGenBase biomegenbase = world.getWorldChunkManager().getBiomeGenAt(x + 16, z + 16); if (biomegenbase == BiomeGenBase.plains ) { } Obviously change BiomeGenBase to your biomegen file, and biomegenbase.plains to yourbiomegenfile.yourbiome. If you want an example heres my structure: http://pastebin.com/9h4ek94g Hope this helps! By the way, if you have checked and are sure that your structure generates properly, can you help me out? I recently posted a thread about my structure not generating right (Don't worry it does generate in only the biome I set, just too much). Heres my post: http://www.minecraftforge.net/forum/index.php/topic,29623.0.html Again, hope this works for you!
  9. I am making a structure that I want to randomly generate in minecraft. I was following a tutorial, but when I tried to run the game and make a new world, it froze while "building terrain". I closed mc, commented out the line where it generated the structure, and tried it again. When I opened the world, I saw that it had generated structures on top of eachother, basically carpeting the world with my structure. How can I change my code to make it more rare? Here is my structure: http://pastebin.com/9h4ek94g And here is my world gen file: http://pastebin.com/iwvdakTK. The tutorial I was following said to change this line to make it more common/rare, specifically the 10: for(int l = 0; l < 10; l++). How do I fix this, and narrow it down to about 4 per biome (Only spawns in plains) so that I can find it quickly in testing? Thank you for any help you can give, I am new to modding!
×
×
  • Create New...

Important Information

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