I used to have a pet goat, and ever since I've loved goats. :biggrin.gif: I like modding things, so of course I had to mod Minecraft too. There aren't any mods that I know of that include goats (except for the Goo Goat in More Creeps and Weirdos) so I made one. :smile.gif: They usually just hang around in small groups, minding their own business, but they pack a punch if you make them mad! Right click one with a bucket and you'll get a bucket of milk! I'm also trying to make them tameable. Goats are tough and can be territorial, so having one on your side can be useful. Currently comes in three colors, which appear randomly.
Bugs:
- Goats despawn after saving and exiting, even when tame.
- If you don't tame a goat with the first item given, it won't accept any more and also stops moving. (In other words, if you get lucky and it only takes one item to tame it, you're fine. But if it takes more than one, you won't be able to tame the goat.)
- If you attack one goat, all the others nearby attack you, instead of just the one you hit. (Leftover from wolf code. I haven't yet learned how to make an entity neutral, and attack only when provoked.)
If anyone can help with the bugs, I'd appreciate it. Entity code is below, under the spoiler because it's really long. Most of it is taken from the wolf, I haven't yet taken out all the stuff I don't need. Also, I'm using a stick as the taming item as a placeholder, because sticks are easy to get in a new test world. It'll be something like wheat or maybe flowers when it's done.
// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.kpdus.com/jad.html // Decompiler options: packimports(3) braces deadcode package net.minecraft.src; import java.util.*; import java.util.Random; // Referenced classes of package net.minecraft.src: // EntityAnimal, DataWatcher, NBTTagCompound, World, // EntityPlayer, EntitySheep, AxisAlignedBB, Entity, // InventoryPlayer, ItemStack, Item, ItemFood, // MathHelper, EntityArrow, EntityLiving public class EntityGoat extends EntityAnimal { boolean GoatColor1 = false; boolean GoatColor2 = false; boolean GoatColor3 = false; public EntityGoat(World world) { super(world); if(rand.nextInt(2) == 0) { texture = "/mob/goat1.png"; GoatColor1 = true; } else if(rand.nextInt(2) == 1) { texture = "/mob/goat2.png"; GoatColor2 = true; } else { texture = "/mob/goat.png"; GoatColor3 = true; } looksWithInterest = false; setSize(1.5F, 1.5F); moveSpeed = 0.7F; health = 42; } protected void entityInit() { super.entityInit(); dataWatcher.addObject(16, Byte.valueOf((byte)0)); dataWatcher.addObject(17, ""); dataWatcher.addObject(18, new Integer(health)); } protected boolean canTriggerWalking() { return false; } public String getEntityTexture() { if(isGoatTamed()) { if (GoatColor1 == true) { return "/mob/goat1.png"; } else if (GoatColor2 == true) { return "/mob/goat2.png"; } else { return "/mob/goat.png"; } } if(isGoatAngry()) { return "/mob/goat.png"; } else { return super.getEntityTexture(); } } public void writeEntityToNBT(NBTTagCompound nbttagcompound) { super.writeEntityToNBT(nbttagcompound); nbttagcompound.setBoolean("Angry", isGoatAngry()); nbttagcompound.setBoolean("Sitting", isGoatSitting()); if(getGoatOwner() != null) { nbttagcompound.setString("Owner", getGoatOwner()); } else { nbttagcompound.setString("Owner", ""); } } public void readEntityFromNBT(NBTTagCompound nbttagcompound) { super.readEntityFromNBT(nbttagcompound); setGoatAngry(nbttagcompound.getBoolean("Angry")); setGoatSitting(nbttagcompound.getBoolean("Sitting")); String s = nbttagcompound.getString("Owner"); if(s.length() > 0) { setGoatOwner(s); setGoatTamed(true); } } protected boolean canDespawn() { return !isGoatTamed(); } protected String getLivingSound() { if(isGoatAngry()) { return "mob.wolf.growl"; } if(rand.nextInt(3) == 0) { if(isGoatTamed() && dataWatcher.getWatchableObjectInt(18) < 10) { return "mob.wolf.whine"; } else { return "mob.wolf.panting"; } } else { return "mob.wolf.bark"; } } protected String getHurtSound() { return "mob.wolf.hurt"; } protected String getDeathSound() { return "mob.wolf.death"; } protected float getSoundVolume() { return 0.4F; } protected int getDropItemId() { return -1; } protected void updatePlayerActionState() { super.updatePlayerActionState(); if(!hasAttacked && !hasPath() && isGoatTamed() && ridingEntity == null) { EntityPlayer entityplayer = worldObj.getPlayerEntityByName(getGoatOwner()); if(entityplayer != null) { float f = entityplayer.getDistanceToEntity(this); if(f > 5F) { getPathOrWalkableBlock(entityplayer, f); } } else if(!isInWater()) { setGoatSitting(true); } } else if(playerToAttack == null && !hasPath() && !isGoatTamed() && worldObj.rand.nextInt(100) == 0) { List list = worldObj.getEntitiesWithinAABB(net.minecraft.src.EntitySheep.class, AxisAlignedBB.getBoundingBoxFromPool(posX, posY, posZ, posX + 1.0D, posY + 1.0D, posZ + 1.0D).expand(16D, 4D, 16D)); if(!list.isEmpty()) { setTarget((Entity)list.get(worldObj.rand.nextInt(list.size()))); } } if(isInWater()) { setGoatSitting(false); } if(!worldObj.multiplayerWorld) { dataWatcher.updateObject(18, Integer.valueOf(health)); } } public void onLivingUpdate() { super.onLivingUpdate(); looksWithInterest = false; if(hasCurrentTarget() && !hasPath() && !isGoatAngry()) { Entity entity = getCurrentTarget(); if(entity instanceof EntityPlayer) { EntityPlayer entityplayer = (EntityPlayer)entity; ItemStack itemstack = entityplayer.inventory.getCurrentItem(); if(itemstack != null) { if(!isGoatTamed() && itemstack.itemID == Item.stick.shiftedIndex) { looksWithInterest = true; } else if(isGoatTamed() && (Item.itemsList[itemstack.itemID] instanceof ItemFood)) { looksWithInterest = ((ItemFood)Item.itemsList[itemstack.itemID]).getIsGoatsFavorite(); } } } } if(!isMultiplayerEntity && isGoatShaking && !field_25052_g && !hasPath() && onGround) { field_25052_g = true; timeGoatIsShaking = 0.0F; prevTimeGoatIsShaking = 0.0F; worldObj.func_9425_a(this, (byte)8); } } public void onUpdate() { super.onUpdate(); field_25054_c = field_25048_b; if(looksWithInterest) { field_25048_b = field_25048_b + (1.0F - field_25048_:cool.gif: * 0.4F; } else { field_25048_b = field_25048_b + (0.0F - field_25048_:cool.gif: * 0.4F; } if(looksWithInterest) { numTicksToChaseTarget = 10; } if(isWet()) { isGoatShaking = true; field_25052_g = false; timeGoatIsShaking = 0.0F; prevTimeGoatIsShaking = 0.0F; } else if((isGoatShaking || field_25052_g) && field_25052_g) { if(timeGoatIsShaking == 0.0F) { worldObj.playSoundAtEntity(this, "mob.wolf.shake", getSoundVolume(), (rand.nextFloat() - rand.nextFloat()) * 0.2F + 1.0F); } prevTimeGoatIsShaking = timeGoatIsShaking; timeGoatIsShaking += 0.05F; if(prevTimeGoatIsShaking >= 2.0F) { isGoatShaking = false; field_25052_g = false; prevTimeGoatIsShaking = 0.0F; timeGoatIsShaking = 0.0F; } if(timeGoatIsShaking > 0.4F) { float f = (float)boundingBox.minY; int i = (int)(MathHelper.sin((timeGoatIsShaking - 0.4F) * 3.141593F) * 7F); for(int j = 0; j < i; j++) { float f1 = (rand.nextFloat() * 2.0F - 1.0F) * width * 0.5F; float f2 = (rand.nextFloat() * 2.0F - 1.0F) * width * 0.5F; worldObj.spawnParticle("splash", posX + (double)f1, f + 0.8F, posZ + (double)f2, motionX, motionY, motionZ); } } } } public boolean getGoatShaking() { return isGoatShaking; } public float getShadingWhileShaking(float f) { return 0.75F + ((prevTimeGoatIsShaking + (timeGoatIsShaking - prevTimeGoatIsShaking) * f) / 2.0F) * 0.25F; } public float getShakeAngle(float f, float f1) { float f2 = (prevTimeGoatIsShaking + (timeGoatIsShaking - prevTimeGoatIsShaking) * f + f1) / 1.8F; if(f2 < 0.0F) { f2 = 0.0F; } else if(f2 > 1.0F) { f2 = 1.0F; } return MathHelper.sin(f2 * 3.141593F) * MathHelper.sin(f2 * 3.141593F * 11F) * 0.15F * 3.141593F; } public float getInterestedAngle(float f) { return (field_25054_c + (field_25048_b - field_25054_c) * f) * 0.15F * 3.141593F; } public float getEyeHeight() { return height * 0.8F; } protected int func_25026_x() { if(isGoatSitting()) { return 20; } else { return super.func_25026_x(); } } private void getPathOrWalkableBlock(Entity entity, float f) { PathEntity pathentity = worldObj.getPathToEntity(this, entity, 16F); if(pathentity == null && f > 12F) { int i = MathHelper.floor_double(entity.posX) - 2; int j = MathHelper.floor_double(entity.posZ) - 2; int k = MathHelper.floor_double(entity.boundingBox.minY); for(int l = 0; l <= 4; l++) { for(int i1 = 0; i1 <= 4; i1++) { if((l < 1 || i1 < 1 || l > 3 || i1 > 3) && worldObj.func_28100_h(i + l, k - 1, j + i1) && !worldObj.func_28100_h(i + l, k, j + i1) && !worldObj.func_28100_h(i + l, k + 1, j + i1)) { setLocationAndAngles((float)(i + l) + 0.5F, k, (float)(j + i1) + 0.5F, rotationYaw, rotationPitch); return; } } } } else { setPathToEntity(pathentity); } } protected boolean isMovementCeased() { return isGoatSitting() || field_25052_g; } public boolean attackEntityFrom(Entity entity, int i) { setGoatSitting(false); if(entity != null && !(entity instanceof EntityPlayer) && !(entity instanceof EntityArrow)) { i = (i + 1) / 2; } if(super.attackEntityFrom(entity, i)) { if(!isGoatTamed() && !isGoatAngry()) { if(entity instanceof EntityPlayer) { setGoatAngry(true); playerToAttack = entity; } if((entity instanceof EntityArrow) && ((EntityArrow)entity).owner != null) { entity = ((EntityArrow)entity).owner; } if(entity instanceof EntityLiving) { List list = worldObj.getEntitiesWithinAABB(net.minecraft.src.EntityGoat.class, AxisAlignedBB.getBoundingBoxFromPool(posX, posY, posZ, posX + 1.0D, posY + 1.0D, posZ + 1.0D).expand(16D, 4D, 16D)); Iterator iterator = list.iterator(); do { if(!iterator.hasNext()) { break; } Entity entity1 = (Entity)iterator.next(); EntityGoat entitygoat = (EntityGoat)entity1; if(!entitygoat.isGoatTamed() && entitygoat.playerToAttack == null) { entitygoat.playerToAttack = entity; if(entity instanceof EntityPlayer) { entitygoat.setGoatAngry(true); } } } while(true); } } else if(entity != this && entity != null) { if(isGoatTamed() && (entity instanceof EntityPlayer) && ((EntityPlayer)entity).username.equalsIgnoreCase(getGoatOwner())) { return true; } playerToAttack = entity; } return true; } else { return false; } } protected Entity findPlayerToAttack() { if(isGoatAngry()) { return worldObj.getClosestPlayerToEntity(this, 16D); } else { return null; } } protected void attackEntity(Entity entity, float f) { if(f > 2.0F && f < 6F && rand.nextInt(10) == 0) { if(onGround) { double d = entity.posX - posX; double d1 = entity.posZ - posZ; float f1 = MathHelper.sqrt_double(d * d + d1 * d1); motionX = (d / (double)f1) * 0.5D * 0.80000001192092896D + motionX * 0.20000000298023224D; motionZ = (d1 / (double)f1) * 0.5D * 0.80000001192092896D + motionZ * 0.20000000298023224D; motionY = 0.40000000596046448D; } } else if((double)f < 1.5D && entity.boundingBox.maxY > boundingBox.minY && entity.boundingBox.minY < boundingBox.maxY) { attackTime = 20; byte byte0 = 2; if(isGoatTamed()) { byte0 = 4; } entity.attackEntityFrom(this, byte0); } } public boolean interact(EntityPlayer entityplayer) { ItemStack itemstack = entityplayer.inventory.getCurrentItem(); if(itemstack != null && itemstack.itemID == Item.bucketEmpty.shiftedIndex) { entityplayer.inventory.setInventorySlotContents(entityplayer.inventory.currentItem, new ItemStack(Item.bucketMilk)); return true; } else if(!isGoatTamed()) { if(itemstack != null && itemstack.itemID == Item.stick.shiftedIndex && !isGoatAngry()) { itemstack.stackSize--; if(itemstack.stackSize <= 0) { entityplayer.inventory.setInventorySlotContents(entityplayer.inventory.currentItem, null); } if(!worldObj.multiplayerWorld) { if(rand.nextInt(3) == 0) { setGoatTamed(true); setPathToEntity(null); setGoatSitting(true); health = 20; setGoatOwner(entityplayer.username); showHeartsOrSmokeFX(true); worldObj.func_9425_a(this, (byte)7); } else { setGoatTamed(true); showHeartsOrSmokeFX(false); worldObj.func_9425_a(this, (byte)6); } } return true; } } else { if(itemstack != null && (Item.itemsList[itemstack.itemID] instanceof ItemFood)) { ItemFood itemfood = (ItemFood)Item.itemsList[itemstack.itemID]; if(itemfood.getIsGoatsFavorite() && dataWatcher.getWatchableObjectInt(18) < 20) { itemstack.stackSize--; if(itemstack.stackSize <= 0) { entityplayer.inventory.setInventorySlotContents(entityplayer.inventory.currentItem, null); } heal(((ItemFood)Item.wheat).getHealAmount()); return true; } } if(entityplayer.username.equalsIgnoreCase(getGoatOwner())) { if(!worldObj.multiplayerWorld) { setGoatSitting(!isGoatSitting()); isJumping = false; setPathToEntity(null); } return true; } } return false; } void showHeartsOrSmokeFX(boolean flag) { String s = "heart"; if(!flag) { s = "smoke"; } for(int i = 0; i < 7; i++) { double d = rand.nextGaussian() * 0.02D; double d1 = rand.nextGaussian() * 0.02D; double d2 = rand.nextGaussian() * 0.02D; worldObj.spawnParticle(s, (posX + (double)(rand.nextFloat() * width * 2.0F)) - (double)width, posY + 0.5D + (double)(rand.nextFloat() * height), (posZ + (double)(rand.nextFloat() * width * 2.0F)) - (double)width, d, d1, d2); } } public void handleHealthUpdate(byte byte0) { if(byte0 == 7) { showHeartsOrSmokeFX(true); } else if(byte0 == 6) { showHeartsOrSmokeFX(false); } else if(byte0 == 8) { field_25052_g = true; timeGoatIsShaking = 0.0F; prevTimeGoatIsShaking = 0.0F; } else { super.handleHealthUpdate(byte0); } } public float setTailRotation() { if(isGoatAngry()) { return 1.53938F; } if(isGoatTamed()) { return (0.55F - (float)(20 - dataWatcher.getWatchableObjectInt(18)) * 0.02F) * 3.141593F; } else { return 0.6283185F; } } public int getMaxSpawnedInChunk() { return 8; } public String getGoatOwner() { return dataWatcher.getWatchableObjectString(17); } public void setGoatOwner(String s) { dataWatcher.updateObject(17, s); } public boolean isGoatSitting() { return (dataWatcher.getWatchableObjectByte(16) & 1) != 0; } public void setGoatSitting(boolean flag) { byte byte0 = dataWatcher.getWatchableObjectByte(16); if(flag) { dataWatcher.updateObject(16, Byte.valueOf((byte)(byte0 | 1))); } else { dataWatcher.updateObject(16, Byte.valueOf((byte)(byte0 & -2))); } } public boolean isGoatAngry() { return (dataWatcher.getWatchableObjectByte(16) & 2) != 0; } public void setGoatAngry(boolean flag) { byte byte0 = dataWatcher.getWatchableObjectByte(16); if(flag) { dataWatcher.updateObject(16, Byte.valueOf((byte)(byte0 | 2))); } else { dataWatcher.updateObject(16, Byte.valueOf((byte)(byte0 & -3))); } } public boolean isGoatTamed() { return (dataWatcher.getWatchableObjectByte(16) & 4) != 0; } public void setGoatTamed(boolean flag) { byte byte0 = dataWatcher.getWatchableObjectByte(16); if(flag) { dataWatcher.updateObject(16, Byte.valueOf((byte)(byte0 | 4))); } else { dataWatcher.updateObject(16, Byte.valueOf((byte)(byte0 & -5))); } } private boolean looksWithInterest; private float field_25048_b; private float field_25054_c; private boolean isGoatShaking; private boolean field_25052_g; private float timeGoatIsShaking; private float prevTimeGoatIsShaking; }
4
Application:
Name:
Coder[] Modeler[] Texture Person[]
Any Experience:
Model For The Goats Is Complete, the template for the texture is also complete, Also the goat meat pic is complete, Thank you juniormac21
The Dog Coding is complete, Thank you juniormac21
The Amazoat Mod will include:
Tamable Goats
Model: http://www.mediafire.com/?dox4ql1w7trxckd
I have one goat texture already made: http://www.mediafire.com/i/?5oea2bb7bm1amoc
Goats:
There are three kinds of goats (I need models and textures of them)
These three different goats can be found roaming around, they are as common as pigs, cow, and sheep.
Don't punch an un-tamed goat, they WILL fight back!
Taming:
To Tame a goat you have to feed it seeds, the number of seeds to feed them varies.
What To Do With A Tame Goat?
After you have tamed your goat they will follow you around, to make them stop following you just right click on them with and empty hand and they will lie down.
Tamed goats get a little black ear stamp in their ear, this ear stamp is color change-able. to change the color you just right click on them with a colored dye and it will change.
You can also milk them by right clicking of them with an empty bucket.
They also turn into somewhat of a warrior. If something attacks you or you punch a mob, your tame goat will run after it and kill it for you, making hunting a breeze.
Breeding:
You can breed two Goats by putting two tame goats into a 4x4 block area and feeding each of the goats 10 seeds. For breeding to work you must be 10 blocks away. Breeding takes about one whole minecraft day. The baby goat is either the same color as one of its parents (Smaller of course) but sometimes you will get a multi-colored one!
What do They Drop At Death?
When a Goat Dies it drops leather and Goat Meat.
(Goat Meat is pretty much a porkchop with horns)
Non-Tamable Elephants
Elephants walk around in big herds, if you are on easy they will only attack if provoked, on normal and hard they will attack you on site!
Tamable Pony
Ponys are just like horses but smaller, They come in black brown and white.
Tamable Birds
Birds are found any where! If you feed them a cookie they will become tame. If you left click on a tamed bird they will sit on your shoulder :laugh.gif:
Tamable Dogs
(Yes Dogs not Wolfs)
Dogs are VERY COMMON, they like people... If you tame one by using bones they will always be at most 3 blocks away when the walk, if you left click on them they will lay on their side.
The Team:
Modeler:
.juniormac21
.
.
.
Texture Person:
.skyguy351
.Ryanosaurus
.aledactle
.
Coders:
.SuperPickaxe (Doing Black Bear)
.Joe12o (Doing Tiger)
.MinecraftArt (Doing Elephant)
.ReviveMyLive (Tamable Animals)
.
Show Your Support!!!!
1
1
Great!!! Do you want to do them all or just a few? :laugh.gif:
1
cool, Well could you do the elephant code?
1
Great your on the Team :smile.gif: Could you do the coding for the tiger?
1
Great I sent you a PM :laugh.gif:
1
Okay I sent you a PM :laugh.gif:
1
1
Sure, i changed it!!!
1