
milogold
Members-
Posts
17 -
Joined
-
Last visited
Converted
-
Gender
Undisclosed
-
Personal Text
I am new!
milogold's Achievements

Tree Puncher (2/8)
0
Reputation
-
Hey guys, I am basically making a series of wands so I need to be able to make them spawn in entities. I managed to get my ender pearl wand working quite easily, but my TNT wand doesn't seem to spawn in the TNT entity on right click. It plays the fuse sound but no entity is spawned Here is my code: public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { par2World.playSoundAtEntity(par3EntityPlayer, "random.fuse", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); if (!par2World.isRemote) { par2World.spawnEntityInWorld(new EntityTNTPrimed(par2World)); par1ItemStack.damageItem(1, par3EntityPlayer); } return par1ItemStack; } If anyone could help out that would be great.
-
Yeah thanks, I literally just figured that our before you posted
-
Hey guys, my smelting recipes aren't working. Can you tell me why? public void smeltingRecipes(){ GameRegistry.addSmelting(this.AquamarineGemID, new ItemStack(AquamarineDust), 1F); GameRegistry.addSmelting(this.CitrineGemID, new ItemStack(CitrineDust), 1F); GameRegistry.addSmelting(this.PlutoniumGemID, new ItemStack(PlutoniumDust), 1F); GameRegistry.addSmelting(this.PearlID, new ItemStack(PearlDust), 1F); GameRegistry.addSmelting(this.SuperGemID, new ItemStack(EnderDust), 1F); }
-
well, then how do I make it so it spawns anywhere in an ocean biome? ;\ And no, with this I don't have a clue what I am doing so it would help if you showed me
-
I am really confused. Could you not just paste in an example of how to use it? This is what I have, is this right? for(int i = 0; i < 4; i++){ int xCoord = chunkX + random.nextInt(16); int yCoord = random.nextInt(64); int zCoord = chunkZ + random.nextInt(16); int x = 0; int z = 0; if(world.getBiomeGenForCoords(x, z) != BiomeGenBase.ocean){ (new WorldGenMinable(gemcraft.Clam.blockID, 4)).generate(world, random, xCoord, yCoord, zCoord); } else { z = z + 10; x = x + 10; } }
-
I will try that, but I am quite inexperienced, where would I put that and what would the full coding for making it only in oceans and rivers be like?
-
Hey guys, I have made an "Ore" which is a clam and I only want it to spawn at the bottom of oceans and rivers. How can I make it so it only spawns in these biomes. Here is my code: for(int i = 0; i < 4; i++){ int xCoord = chunkX + random.nextInt(16); int yCoord = random.nextInt(64); int zCoord = chunkZ + random.nextInt(16); (new WorldGenMinable(gemcraft.Clam.blockID, 4)).generate(world, random, xCoord, yCoord, zCoord); } I am aware that for it to spawn at the bottom of the oceans I would need to make a custom WorldGenMinable, to make it spawn in dirt.
-
[Solved] Ore Generation in Nether + very weird crafting recipe glitch?
milogold replied to milogold's topic in Modder Support
dw I fixed it haha, I suck. And thanks, the helmet thing is also fixed. Thanks for your patience -
[Solved] Ore Generation in Nether + very weird crafting recipe glitch?
milogold replied to milogold's topic in Modder Support
lol, thanks both of you, btw do any of you know what is wrong with this? //Citrine Helmet GameRegistry.addRecipe(new ItemStack(gemcraft.CitrineHelmet), new Object[]{ "CCC", "C C", " ", 'C', CitrineGem, }); -
[Solved] Ore Generation in Nether + very weird crafting recipe glitch?
milogold replied to milogold's topic in Modder Support
ahh, thanks. What should I use instead. -
Hey, so I have made an ore called Hell Ore and I wanted it to spawn in the nether. After looking around the nether for an hour- in multiple worlds, I could not find my ore, I also tried with multiple spawn rates. Here is the code for the world gen: private void generateNether(World world, Random random, int chunkX, int chunkZ) { for(int i = 0; i < 45; i++){ int xCoord = chunkX + random.nextInt(16); int yCoord = random.nextInt(95); int zCoord = chunkZ + random.nextInt(16); (new WorldGenMinable(gemcraft.HellOre.blockID, 15)).generate(world, random, xCoord, yCoord, zCoord); } } If anyone could help me with that, that would be great. Also, when making a crafting recipe for one of my armor pieces I have come across a strange glitch. The recipe is for my Citrine Helmet and all the other recipes work fine. My glitch is that when I place the crafting table down and open it the Citrine Helmet is already in the crafting bench, as if the recipe for it is "","","". Here is my code for that: //Citrine Helmet GameRegistry.addRecipe(new ItemStack(gemcraft.CitrineHelmet), new Object[]{ "CCC", "C C", "", 'C', CitrineGem, });
-
Hey guys, I have just made my new mob (Sand Pig). I can spawn it in with an spawnegg and it looks fine (With one little exception of the legs not moving when it moves). The problem is it won't spawn, here is the code I have for spawning it: public void entityRegisters(){ EntityRegistry.registerModEntity(EntitySandPig.class, "Sand Pig", 1, this, 80, 3, true); EntityRegistry.addSpawn(EntitySandPig.class, 10, 3, 6, EnumCreatureType.creature, BiomeGenBase.desert, BiomeGenBase.desertHills); I really do not have a clue why this isn't spawning so if anyone could help me out I would appreciate it. (Btw I am new to Java coding and don't understand all of the code) Also if anyone knows why it's legs don't move when it moves I would appreciate it if you helped out with that as well
-
I took a look, still don't know what to do ;s
-
It's a bit of a mess at the moment (btw I am a little inexperienced in java modding). This is what I have for the ItemWoodenBucket class: public class ItemWoodenBucket extends Item{ public ItemWoodenBucket(int par1) { super(par1); setMaxStackSize(64); setCreativeTab(CreativeTabs.tabMisc); } public String getTextureFile(){ return "/gemcraft/gemcraft_textures.png"; } private int isFull; public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { float var4 = 1.0F; double var5 = par3EntityPlayer.prevPosX + (par3EntityPlayer.posX - par3EntityPlayer.prevPosX) * (double)var4; double var7 = par3EntityPlayer.prevPosY + (par3EntityPlayer.posY - par3EntityPlayer.prevPosY) * (double)var4 + 1.62D - (double)par3EntityPlayer.yOffset; double var9 = par3EntityPlayer.prevPosZ + (par3EntityPlayer.posZ - par3EntityPlayer.prevPosZ) * (double)var4; boolean var11 = this.isFull == 0; MovingObjectPosition var12 = this.getMovingObjectPositionFromPlayer(par2World, par3EntityPlayer, var11); if (this.isFull == 0 && var12.entityHit instanceof GemcraftPig) { return new ItemStack(gemcraft.WoodenBucketUrine); } return par1ItemStack; } } And this is what I have for my GemcraftPig class: public class GemcraftPig extends EntityPig{ private final EntityAIControlledByPlayer aiControlledByPlayer; public GemcraftPig(World par1World) { super(par1World); this.texture = "/mob/pig.png"; this.setSize(0.9F, 0.9F); this.getNavigator().setAvoidsWater(true); float var2 = 0.25F; this.tasks.addTask(0, new EntityAISwimming(this)); this.tasks.addTask(1, new EntityAIPanic(this, 0.38F)); this.tasks.addTask(2, this.aiControlledByPlayer = new EntityAIControlledByPlayer(this, 0.34F)); this.tasks.addTask(3, new EntityAIMate(this, var2)); this.tasks.addTask(4, new EntityAITempt(this, 0.3F, Item.carrotOnAStick.itemID, false)); this.tasks.addTask(4, new EntityAITempt(this, 0.3F, Item.carrot.itemID, false)); this.tasks.addTask(5, new EntityAIFollowParent(this, 0.28F)); this.tasks.addTask(6, new EntityAIWander(this, var2)); this.tasks.addTask(7, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F)); this.tasks.addTask(8, new EntityAILookIdle(this)); } public boolean interact(EntityPlayer par1EntityPlayer) { ItemStack var2 = par1EntityPlayer.inventory.getCurrentItem(); if (var2 != null && var2.itemID == gemcraft.WoodenBucket.itemID) { if (--var2.stackSize <= 0) { par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, new ItemStack(gemcraft.WoodenBucketUrine)); } else if (!par1EntityPlayer.inventory.addItemStackToInventory(new ItemStack(gemcraft.WoodenBucketUrine))) { par1EntityPlayer.dropPlayerItem(new ItemStack(gemcraft.WoodenBucketUrine.itemID, 1, 0)); } return true; } else { return super.interact(par1EntityPlayer); } } }
-
Hey guys, I really need some help with something I am trying to code. Before I start don't ask about the weird stuff I am trying to create So I am trying to create a Wooden Bucket, that when you right click on a pig with, you get a bucket of urine. I have declared the WoodenBucket and WoodenBucketUrine in the main class and I have made ItemWoodenBucket and ItemWoodenBucketUrine. From there I tried copying the code from bucket where it allows you to milk a cow, over to the ItemWoodenBucket (And renamed everything obviously). I tried with that and it didn't work. After that I made a GemcraftPig class where I made it extend EntityPig and copied over the bit of code from EntityCow where you can milk it. It still didn't work. Could someone help me out? I basically need to know how to make my Wooden Bucket "Milk" a pig, when you right click one, to get my Wooden Bucket of Urine.