Jump to content

saxon564

Forge Modder
  • Posts

    490
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by saxon564

  1. for some reason the CommonProxy class doesnt seem to be registering right. here the logs for the error Main Class: package mods.mochickens; import java.util.List; import mods.mochickens.client.ClientProxyMoChickens; import mods.mochickens.misc.SoundEvents; import mods.mochickens.mobs.EntityCoalChicken; import mods.mochickens.mobs.EntityCookieChicken; import mods.mochickens.mobs.EntityDiamondChicken; import mods.mochickens.mobs.EntityEmeraldChicken; import mods.mochickens.mobs.EntityEnderChicken; import mods.mochickens.mobs.EntityGiantChicken; import mods.mochickens.mobs.EntityGoldChicken; import mods.mochickens.mobs.EntityIronChicken; import mods.mochickens.mobs.EntityLapisChicken; import mods.mochickens.mobs.EntityRedstoneChicken; import mods.mochickens.mobs.EntitySkeletonChicken; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityEggInfo; import net.minecraft.entity.EntityList; import net.minecraft.entity.EnumCreatureType; import net.minecraft.item.EnumToolMaterial; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.CraftingManager; import net.minecraft.item.crafting.IRecipe; import net.minecraft.server.MinecraftServer; import net.minecraft.world.biome.BiomeGenBase; import net.minecraftforge.common.Configuration; import net.minecraftforge.common.EnumHelper; import net.minecraftforge.common.MinecraftForge; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.EventHandler; import cpw.mods.fml.common.Mod.Init; import cpw.mods.fml.common.Mod.Instance; import cpw.mods.fml.common.Mod.PreInit; import cpw.mods.fml.common.SidedProxy; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.network.NetworkMod; import cpw.mods.fml.common.network.NetworkRegistry; import cpw.mods.fml.common.registry.EntityRegistry; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.common.registry.LanguageRegistry; @Mod(modid = "mochickens", name = "Mo' Chickens", version = "1.0") @NetworkMod(clientSideRequired = true, serverSideRequired = false) public class MoChickens { @SidedProxy(clientSide = "mods.mochickens.client.ClientProxyMoChickens", serverSide = "mods.mochickens.proxies.CommonProxyMoChickens") public static ClientProxyMoChickens proxy; @Instance("mochickens") public static MoChickens instance; int diamondChickenEggID; int coalChickenEggID; int ironChickenEggID; int redstoneChickenEggID; int lapisChickenEggID; int emeraldChickenEggID; int goldChickenEggID; int skeletonChickenEggID; int enderChickenEggID; int cookieChickenEggID; int giantChickenEggID; static int startEntityId = 300; @EventHandler public void preInit(FMLPreInitializationEvent event) { Configuration config = new Configuration(event.getSuggestedConfigurationFile()); diamondChickenEggID = config.get("Egg IDs", "Diamond Chicken Egg ID", 514).getInt(); coalChickenEggID = config.get("Egg IDs", "Coal Chicken Egg ID", 515).getInt(); ironChickenEggID = config.get("Egg IDs", "Iron Chicken Egg ID", 516).getInt(); redstoneChickenEggID = config.get("Egg IDs", "Redstone Chicken Egg ID", 517).getInt(); lapisChickenEggID = config.get("Egg IDs", "Lapis Chicken Egg ID", 518).getInt(); emeraldChickenEggID = config.get("Egg IDs", "Emerald Chicken Egg ID", 519).getInt(); goldChickenEggID = config.get("Egg IDs", "Gold Chicken Egg ID", 520).getInt(); skeletonChickenEggID = config.get("Egg IDs", "Skeleton Chicken Egg ID", 521).getInt(); enderChickenEggID = config.get("Egg IDs", "Ender Chicken Egg ID", 522).getInt(); cookieChickenEggID = config.get("Egg IDs", "Cookie Chicken Egg ID", 522).getInt(); giantChickenEggID = config.get("Egg IDs", "Giant Chicken Egg ID", 522).getInt(); config.save(); proxy.registerSounds(); } @EventHandler public void load(FMLInitializationEvent event){ languageRegisters(); entityRegisters(); entitySpawns(); EggRegisters(); proxy.registerRenders(); } // Add Spawn Egg public static int getUniqueEntityID() { do { startEntityId++; } while(EntityList.getStringFromID(startEntityId) != null); return startEntityId; } public static void registerEntityEgg(Class <? extends Entity> entity, int primaryColor, int secondaryColor) { int id = getUniqueEntityID(); EntityList.IDtoClassMapping.put(id, entity); EntityList.entityEggs.put(id, new EntityEggInfo(id, primaryColor, secondaryColor)); } public void EggRegisters() { registerEntityEgg(EntityDiamondChicken.class, 0xa8e2e2, 0x000000); registerEntityEgg(EntityCoalChicken.class, 0x2e2e2e, 0x000000); registerEntityEgg(EntityIronChicken.class, 0xd7d0b2, 0x000000); registerEntityEgg(EntityGoldChicken.class, 0xccda2b, 0x000000); registerEntityEgg(EntityLapisChicken.class, 0x4b4bcc, 0x000000); registerEntityEgg(EntityRedstoneChicken.class, 0xff6464, 0x000000); registerEntityEgg(EntityEmeraldChicken.class, 0x06cc01, 0x000000); registerEntityEgg(EntitySkeletonChicken.class, 0xFFFFFF, 0x000000); registerEntityEgg(EntityEnderChicken.class, 0x000000, 0x797979); registerEntityEgg(EntityCookieChicken.class, 0xe79042, 0x000000); registerEntityEgg(EntityGiantChicken.class, 0xe2e2e2, 0x000000); } //Add Mobs public void entityRegisters() { EntityRegistry.registerModEntity(EntityDiamondChicken.class,"DiamondChicken", 500, this , 40, 3, true); EntityRegistry.registerModEntity(EntityCoalChicken.class,"CoalChicken", 501, this , 40, 3, true); EntityRegistry.registerModEntity(EntityIronChicken.class,"IronChicken", 502, this , 40, 3, true); EntityRegistry.registerModEntity(EntityGoldChicken.class,"GoldChicken", 503, this , 40, 3, true); EntityRegistry.registerModEntity(EntityLapisChicken.class,"LapisChicken", 504, this , 40, 3, true); EntityRegistry.registerModEntity(EntityRedstoneChicken.class,"RedstoneChicken", 505, this , 40, 3, true); EntityRegistry.registerModEntity(EntityEmeraldChicken.class,"EmeraldChicken", 506, this , 40, 3, true); EntityRegistry.registerModEntity(EntitySkeletonChicken.class,"SkeletonChicken", 507, this , 40, 3, true); EntityRegistry.registerModEntity(EntityEnderChicken.class,"EnderChicken", 508, this , 40, 3, true); EntityRegistry.registerModEntity(EntityCookieChicken.class,"CookieChicken", 509, this , 40, 3, true); EntityRegistry.registerModEntity(EntityGiantChicken.class,"GiantChicken", 510, this , 40, 3, true); } //Add Spawns public void entitySpawns() { EntityRegistry.addSpawn(EntityDiamondChicken.class, 5, 1, 2, EnumCreatureType.creature, BiomeGenBase.beach, BiomeGenBase.extremeHills, BiomeGenBase.extremeHillsEdge, BiomeGenBase.forest, BiomeGenBase.forestHills, BiomeGenBase.jungle, BiomeGenBase.jungleHills, BiomeGenBase.mushroomIsland, BiomeGenBase.mushroomIslandShore, BiomeGenBase.ocean, BiomeGenBase.plains, BiomeGenBase.river, BiomeGenBase.swampland); EntityRegistry.addSpawn(EntityCoalChicken.class, 10, 1, 5, EnumCreatureType.creature, BiomeGenBase.beach, BiomeGenBase.extremeHills, BiomeGenBase.extremeHillsEdge, BiomeGenBase.forest, BiomeGenBase.forestHills, BiomeGenBase.jungle, BiomeGenBase.jungleHills, BiomeGenBase.mushroomIsland, BiomeGenBase.mushroomIslandShore, BiomeGenBase.ocean, BiomeGenBase.plains, BiomeGenBase.river, BiomeGenBase.swampland); EntityRegistry.addSpawn(EntityIronChicken.class, 9, 1, 3, EnumCreatureType.creature, BiomeGenBase.beach, BiomeGenBase.extremeHills, BiomeGenBase.extremeHillsEdge, BiomeGenBase.forest, BiomeGenBase.forestHills, BiomeGenBase.jungle, BiomeGenBase.jungleHills, BiomeGenBase.mushroomIsland, BiomeGenBase.mushroomIslandShore, BiomeGenBase.ocean, BiomeGenBase.plains, BiomeGenBase.river, BiomeGenBase.swampland); EntityRegistry.addSpawn(EntityGoldChicken.class, 7, 1, 2, EnumCreatureType.creature, BiomeGenBase.beach, BiomeGenBase.extremeHills, BiomeGenBase.extremeHillsEdge, BiomeGenBase.forest, BiomeGenBase.forestHills, BiomeGenBase.jungle, BiomeGenBase.jungleHills, BiomeGenBase.mushroomIsland, BiomeGenBase.mushroomIslandShore, BiomeGenBase.ocean, BiomeGenBase.plains, BiomeGenBase.river, BiomeGenBase.swampland); EntityRegistry.addSpawn(EntityLapisChicken.class, 7, 1, 2, EnumCreatureType.creature, BiomeGenBase.beach, BiomeGenBase.extremeHills, BiomeGenBase.extremeHillsEdge, BiomeGenBase.forest, BiomeGenBase.forestHills, BiomeGenBase.jungle, BiomeGenBase.jungleHills, BiomeGenBase.mushroomIsland, BiomeGenBase.mushroomIslandShore, BiomeGenBase.ocean, BiomeGenBase.plains, BiomeGenBase.river, BiomeGenBase.swampland); EntityRegistry.addSpawn(EntityRedstoneChicken.class, 6, 1, 2, EnumCreatureType.creature, BiomeGenBase.beach, BiomeGenBase.extremeHills, BiomeGenBase.extremeHillsEdge, BiomeGenBase.forest, BiomeGenBase.forestHills, BiomeGenBase.jungle, BiomeGenBase.jungleHills, BiomeGenBase.mushroomIsland, BiomeGenBase.mushroomIslandShore, BiomeGenBase.ocean, BiomeGenBase.plains, BiomeGenBase.river, BiomeGenBase.swampland); EntityRegistry.addSpawn(EntityEmeraldChicken.class, 5, 1, 2, EnumCreatureType.creature, BiomeGenBase.beach, BiomeGenBase.extremeHills, BiomeGenBase.extremeHillsEdge, BiomeGenBase.forest, BiomeGenBase.forestHills, BiomeGenBase.jungle, BiomeGenBase.jungleHills, BiomeGenBase.mushroomIsland, BiomeGenBase.mushroomIslandShore, BiomeGenBase.ocean, BiomeGenBase.plains, BiomeGenBase.river, BiomeGenBase.swampland); EntityRegistry.addSpawn(EntitySkeletonChicken.class, 10, 1, 2, EnumCreatureType.monster, BiomeGenBase.beach, BiomeGenBase.extremeHills, BiomeGenBase.extremeHillsEdge, BiomeGenBase.forest, BiomeGenBase.forestHills, BiomeGenBase.jungle, BiomeGenBase.jungleHills, BiomeGenBase.mushroomIsland, BiomeGenBase.mushroomIslandShore, BiomeGenBase.ocean, BiomeGenBase.plains, BiomeGenBase.river, BiomeGenBase.swampland); EntityRegistry.addSpawn(EntityEnderChicken.class, 3, 1, 2, EnumCreatureType.creature, BiomeGenBase.beach, BiomeGenBase.extremeHills, BiomeGenBase.extremeHillsEdge, BiomeGenBase.forest, BiomeGenBase.forestHills, BiomeGenBase.jungle, BiomeGenBase.jungleHills, BiomeGenBase.mushroomIsland, BiomeGenBase.mushroomIslandShore, BiomeGenBase.ocean, BiomeGenBase.plains, BiomeGenBase.river, BiomeGenBase.swampland); EntityRegistry.addSpawn(EntityEnderChicken.class, 10, 1, 2, EnumCreatureType.creature, BiomeGenBase.sky); EntityRegistry.addSpawn(EntityCookieChicken.class, 6, 1, 2, EnumCreatureType.creature, BiomeGenBase.beach, BiomeGenBase.extremeHills, BiomeGenBase.extremeHillsEdge, BiomeGenBase.forest, BiomeGenBase.forestHills, BiomeGenBase.jungle, BiomeGenBase.jungleHills, BiomeGenBase.mushroomIsland, BiomeGenBase.mushroomIslandShore, BiomeGenBase.ocean, BiomeGenBase.plains, BiomeGenBase.river, BiomeGenBase.swampland); EntityRegistry.addSpawn(EntityGiantChicken.class, 4, 1, 2, EnumCreatureType.creature, BiomeGenBase.beach, BiomeGenBase.extremeHills, BiomeGenBase.extremeHillsEdge, BiomeGenBase.forest, BiomeGenBase.forestHills, BiomeGenBase.jungle, BiomeGenBase.jungleHills, BiomeGenBase.mushroomIsland, BiomeGenBase.mushroomIslandShore, BiomeGenBase.ocean, BiomeGenBase.plains, BiomeGenBase.river, BiomeGenBase.swampland); } private static void languageRegisters() { LanguageRegistry.instance().addStringLocalization("entity.mochickens.DiamondChicken.name", "Diamond Chicken"); LanguageRegistry.instance().addStringLocalization("entity.mochickens.CoalChicken.name", "Coal Chicken"); LanguageRegistry.instance().addStringLocalization("entity.mochickens.IronChicken.name", "Iron Chicken"); LanguageRegistry.instance().addStringLocalization("entity.mochickens.GoldChicken.name", "Gold Chicken"); LanguageRegistry.instance().addStringLocalization("entity.mochickens.LapisChicken.name", "Lapis Chicken"); LanguageRegistry.instance().addStringLocalization("entity.mochickens.RedstoneChicken.name", "Redstone Chicken"); LanguageRegistry.instance().addStringLocalization("entity.mochickens.EmeraldChicken.name", "Emerald Chicken"); LanguageRegistry.instance().addStringLocalization("entity.mochickens.SkeletonChicken.name", "Skeleton Chicken"); LanguageRegistry.instance().addStringLocalization("entity.mochickens.EnderChicken.name", "Ender Chicken"); LanguageRegistry.instance().addStringLocalization("entity.mochickens.CookieChicken.name", "Cookie Chicken"); LanguageRegistry.instance().addStringLocalization("entity.mochickens.GiantChicken.name", "Giant Chicken"); } } Common Proxy: package mods.mochickens.proxies; import cpw.mods.fml.common.network.IGuiHandler; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.world.World; public class CommonProxyMoChickens { public void registerRenders(){ } } i have a feeling im missing something in the CommonProxy class, but i dont know what it is.
  2. i dont think that the end stops creature spawns, and i did override the getCanSpawnHere() method to allow endstone. heres the code for the enderchicken, be fore warned, it is not very clean right now. package mods.mochickens.mobs; import java.util.UUID; import java.util.logging.Logger; import mods.mochickens.misc.ChickAITempt; import mods.mochickens.misc.ChickTameable; import net.minecraft.block.Block; import net.minecraft.block.BlockColored; import net.minecraft.client.Minecraft; import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.enchantment.EnchantmentThorns; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityAgeable; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.SharedMonsterAttributes; import net.minecraft.entity.ai.EntityAIAttackOnCollide; import net.minecraft.entity.ai.EntityAIFollowParent; import net.minecraft.entity.ai.EntityAILookIdle; import net.minecraft.entity.ai.EntityAIMate; import net.minecraft.entity.ai.EntityAINearestAttackableTarget; import net.minecraft.entity.ai.EntityAIPanic; import net.minecraft.entity.ai.EntityAISwimming; import net.minecraft.entity.ai.EntityAITempt; import net.minecraft.entity.ai.EntityAIWander; import net.minecraft.entity.ai.EntityAIWatchClosest; import net.minecraft.entity.ai.attributes.AttributeInstance; import net.minecraft.entity.ai.attributes.AttributeModifier; import net.minecraft.entity.passive.EntityTameable; import net.minecraft.entity.passive.EntityWolf; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.Item; import net.minecraft.item.ItemFood; import net.minecraft.item.ItemSeeds; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.pathfinding.PathEntity; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import net.minecraft.server.MinecraftServer; import net.minecraft.util.DamageSource; import net.minecraft.util.EntityDamageSource; import net.minecraft.util.EntityDamageSourceIndirect; import net.minecraft.util.MathHelper; import net.minecraft.util.Vec3; import net.minecraft.world.World; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.entity.living.EnderTeleportEvent; public class EntityEnderChicken extends EntityTameable { private static final UUID attackingSpeedBoostModifierUUID = UUID .fromString("020E0DFB-87AE-4653-9556-831010E291A0"); private static final AttributeModifier attackingSpeedBoostModifier = (new AttributeModifier( attackingSpeedBoostModifierUUID, "Attacking speed boost", 6.199999809265137D, 0)).setSaved(false); private int stareTimer; private Entity lastEntityToAttack; private boolean isAggressive; private int teleportDelay; public boolean field_70885_d = false; public float field_70886_e = 0.0F; public float destPos = 0.0F; public float field_70884_g; public float field_70888_h; public float field_70889_i = 1.0F; private int checked = this.worldObj.difficultySetting; /** The time until the next egg is spawned. */ public int timeUntilNextEgg; public EntityEnderChicken(World par1World) { super(par1World); this.setSize(0.3F, 0.7F); float f = 0.25F; this.tasks.addTask(0, new EntityAISwimming(this)); this.tasks.addTask(2, new EntityAIMate(this, 1.0D)); this.tasks.addTask(4, new EntityAIFollowParent(this, 1.1D)); this.tasks.addTask(5, new EntityAIWander(this, 1.0D)); this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F)); this.tasks.addTask(7, new EntityAILookIdle(this)); this.timeUntilNextEgg = -1; this.setTamed(false); } protected void entityInit() { super.entityInit(); this.dataWatcher.addObject(18, new Byte((byte) 0)); } /** * Returns true if the newer Entity AI code should be run */ public boolean isAIEnabled() { return true; } protected void applyEntityAttributes() { super.applyEntityAttributes(); this.getEntityAttribute(SharedMonsterAttributes.maxHealth) .setAttribute(20.0D); this.getEntityAttribute(SharedMonsterAttributes.movementSpeed) .setAttribute(0.25D); } @Override public final void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { super.readEntityFromNBT(par1NBTTagCompound); String s = par1NBTTagCompound.getString("Owner"); if (s.length() > 0) { this.setTamed(true); this.setOwner(s); } } @Override public boolean getCanSpawnHere() { int i = MathHelper.floor_double(this.posX); int j = MathHelper.floor_double(this.boundingBox.minY); int k = MathHelper.floor_double(this.posZ); return (this.worldObj.getBlockId(i, j - 1, k) == Block.grass.blockID || this.worldObj.getBlockId(i, j - 1, k) == 121 || this.worldObj.getBlockId(i, j - 1, k) == Block.stone.blockID) && this.worldObj.getFullBlockLightValue(i, j, k) > 8 && super.getCanSpawnHere(); } @Override public void setTamed(boolean par1) { byte b0 = this.dataWatcher.getWatchableObjectByte(16); MinecraftServer .getServer() .getLogAgent() .logInfo( "cookie X:" + this.posX + " Y:" + this.posY + " Z:" + this.posZ); if (par1) { this.dataWatcher.updateObject(16, Byte.valueOf((byte) (b0 | 4))); this.worldObj.setEntityState(this, (byte) 7); this.tasks.removeTask(new EntityAIAttackOnCollide(this, EntityPlayer.class, 1.0D, false)); this.targetTasks.taskEntries.clear(); this.tasks.addTask(3, new ChickAITempt(this, 1.0D, Item.eyeOfEnder.itemID, false)); this.timeUntilNextEgg = this.rand.nextInt(6000) + 6000; } else { this.tasks.addTask(2, new EntityAIAttackOnCollide(this, EntityPlayer.class, 1.0D, false)); this.targetTasks.addTask(1, new EntityAINearestAttackableTarget( this, EntityPlayer.class, 0, true)); this.dataWatcher.updateObject(16, Byte.valueOf((byte) (b0 & -5))); } if (this.worldObj.difficultySetting == 0) { this.difficultyChange(); } } public boolean attackEntityAsMob(Entity par1Entity) { if (!this.isTamed()) { EntityPlayer entityplayer = this.worldObj .getClosestVulnerablePlayerToEntity(this, 16.0D); // f = damage delt 2.0D = 1 heart float f = (float) 6.0D; int i = 0; if (entityplayer instanceof EntityLivingBase) { f += EnchantmentHelper.getEnchantmentModifierLiving(this, (EntityLivingBase) entityplayer); i += EnchantmentHelper.getKnockbackModifier(this, (EntityLivingBase) entityplayer); entityplayer.addPotionEffect(new PotionEffect( Potion.weakness.id, 200, 3)); entityplayer.addPotionEffect(new PotionEffect( Potion.blindness.id, 200, 5)); } boolean flag = par1Entity.attackEntityFrom( DamageSource.causeMobDamage(this), f); if (flag) { if (i > 0) { entityplayer.addVelocity( (double) (-MathHelper.sin(this.rotationYaw * (float) Math.PI / 180.0F) * (float) i * 0.5F), 0.1D, (double) (MathHelper.cos(this.rotationYaw * (float) Math.PI / 180.0F) * (float) i * 0.5F)); this.motionX *= 0.6D; this.motionZ *= 0.6D; } int j = EnchantmentHelper.getFireAspectModifier(this); if (j > 0) { entityplayer.setFire(j * 4); } if (entityplayer instanceof EntityLivingBase) { EnchantmentThorns.func_92096_a(this, (EntityLivingBase) entityplayer, this.rand); } } return flag; } else { return false; } } public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { if (this.isEntityInvulnerable()) { return false; } else { this.setScreaming(true); if (par1DamageSource instanceof EntityDamageSource && par1DamageSource.getEntity() instanceof EntityPlayer) { this.isAggressive = true; } if (par1DamageSource instanceof EntityDamageSourceIndirect) { this.isAggressive = false; for (int i = 0; i < 64; ++i) { if (this.teleportRandomly()) { return true; } } return super.attackEntityFrom(par1DamageSource, par2); } else { return super.attackEntityFrom(par1DamageSource, par2); } } } /** * Called frequently so the entity can update its state every tick as * required. For example, zombies and skeletons use this to react to * sunlight and start to burn. */ public void onLivingUpdate() { super.onLivingUpdate(); this.field_70888_h = this.field_70886_e; this.field_70884_g = this.destPos; this.destPos = (float) ((double) this.destPos + (double) (this.onGround ? -1 : 4) * 0.3D); if (this.destPos < 0.0F) { this.destPos = 0.0F; } if (this.destPos > 1.0F) { this.destPos = 1.0F; } if (!this.onGround && this.field_70889_i < 1.0F) { this.field_70889_i = 1.0F; } this.field_70889_i = (float) ((double) this.field_70889_i * 0.9D); if (!this.onGround && this.motionY < 0.0D) { this.motionY *= 0.6D; } this.field_70886_e += this.field_70889_i * 2.0F; if (this.worldObj.difficultySetting != checked) { this.difficultyChange(); checked = this.worldObj.difficultySetting; } if (this.isWet()) { this.attackEntityFrom(DamageSource.drown, 1.0F); } if (this.lastEntityToAttack != this.entityToAttack) { AttributeInstance attributeinstance = this .getEntityAttribute(SharedMonsterAttributes.movementSpeed); attributeinstance.removeModifier(attackingSpeedBoostModifier); if (this.entityToAttack != null) { attributeinstance.applyModifier(attackingSpeedBoostModifier); } } this.lastEntityToAttack = this.entityToAttack; int i; if (!this.worldObj.isRemote && this.worldObj.getGameRules().getGameRuleBooleanValue( "mobGriefing")) { int j; int k; int l; if (this.rand.nextInt(2000) == 0) { i = MathHelper.floor_double(this.posX - 1.0D + this.rand.nextDouble() * 2.0D); j = MathHelper.floor_double(this.posY + this.rand.nextDouble() * 2.0D); k = MathHelper.floor_double(this.posZ - 1.0D + this.rand.nextDouble() * 2.0D); l = this.worldObj.getBlockId(i, j, k); int i1 = this.worldObj.getBlockId(i, j - 1, k); } } for (i = 0; i < 2; ++i) { this.worldObj.spawnParticle("portal", this.posX + (this.rand.nextDouble() - 0.5D) * (double) this.width, this.posY + this.rand.nextDouble() * (double) this.height - 0.25D, this.posZ + (this.rand.nextDouble() - 0.5D) * (double) this.width, (this.rand.nextDouble() - 0.5D) * 2.0D, -this.rand.nextDouble(), (this.rand.nextDouble() - 0.5D) * 2.0D); } if (this.worldObj.isDaytime() && !this.worldObj.isRemote) { float f = this.getBrightness(1.0F); if (f > 0.5F && this.worldObj.canBlockSeeTheSky( MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)) && this.rand.nextFloat() * 30.0F < (f - 0.4F) * 2.0F) { this.entityToAttack = null; this.setScreaming(false); this.isAggressive = false; this.teleportRandomly(); } } if (this.isWet() || this.isBurning()) { this.entityToAttack = null; this.setScreaming(false); this.isAggressive = false; this.teleportRandomly(); } if (this.isScreaming() && !this.isAggressive && this.rand.nextInt(100) == 0) { this.setScreaming(false); } this.isJumping = false; if (this.entityToAttack != null) { this.faceEntity(this.entityToAttack, 100.0F, 100.0F); } if (!this.worldObj.isRemote && this.isEntityAlive()) { if (this.entityToAttack != null) { if (this.entityToAttack instanceof EntityPlayer) { if (this.entityToAttack.getDistanceSqToEntity(this) < 16.0D) { this.teleportRandomly(); } this.teleportDelay = 0; } else if (this.entityToAttack.getDistanceSqToEntity(this) > 256.0D && this.teleportDelay++ >= 30 && this.teleportToEntity(this.entityToAttack)) { this.teleportDelay = 0; } } else { this.setScreaming(false); this.teleportDelay = 0; } } super.onLivingUpdate(); if (!this.isChild() && !this.worldObj.isRemote && --this.timeUntilNextEgg == 0) { this.playSound( "mob.chicken.plop", 1.0F, (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F); this.dropItem(Item.enderPearl.itemID, 1); this.timeUntilNextEgg = this.rand.nextInt(6000) + 6000; } } private void difficultyChange() { if (this.worldObj.difficultySetting == 0) { this.setPathToEntity((PathEntity) null); this.setAttackTarget((EntityLivingBase) null); this.setTarget(null); this.tasks.removeTask(new EntityAIAttackOnCollide(this, EntityPlayer.class, 1.0D, false)); this.targetTasks.taskEntries.clear(); } else { String s = this.getOwnerName(); if (s.length() > 0) { this.setTamed(true); this.setOwner(s); } else { this.setTamed(false); } } } /** * Called when the mob is falling. Calculates and applies fall damage. */ protected void fall(float par1) { } /** * Returns the sound this mob makes while it's alive. */ protected String getLivingSound() { return "mob.chicken.say"; } /** * Returns the sound this mob makes when it is hurt. */ protected String getHurtSound() { return "mob.chicken.hurt"; } /** * Returns the sound this mob makes on death. */ protected String getDeathSound() { return "mob.chicken.hurt"; } /** * Plays step sound at given x, y, z for the entity */ protected void playStepSound(int par1, int par2, int par3, int par4) { this.playSound("mob.chicken.step", 0.15F, 1.0F); } /** * Returns the item ID for the item the mob drops on death. */ protected int getDropItemId() { return Item.feather.itemID; } /** * Drop 0-2 items of this living's type. @param par1 - Whether this entity * has recently been hit by a player. @param par2 - Level of Looting used to * kill this mob. */ protected void dropFewItems(boolean par1, int par2) { int j = this.rand.nextInt(3) + this.rand.nextInt(1 + par2); for (int k = 0; k < j; ++k) { if (this.isTamed()) { this.dropItem(Item.enderPearl.itemID, 1); } else { this.dropItem(Item.egg.itemID, 1); } } if (this.isBurning()) { this.dropItem(Item.chickenCooked.itemID, 1); } else { this.dropItem(Item.chickenRaw.itemID, 1); } } /** * Called when a player interacts with a mob. e.g. gets milk from a cow, * gets into the saddle on a pig. */ public boolean interact(EntityPlayer par1EntityPlayer) { ItemStack itemstack = par1EntityPlayer.inventory.getCurrentItem(); if (!this.isTamed()) { if (itemstack != null && itemstack.itemID == Item.eyeOfEnder.itemID) { if (!par1EntityPlayer.capabilities.isCreativeMode) { --itemstack.stackSize; } if (itemstack.stackSize <= 0) { par1EntityPlayer.inventory.setInventorySlotContents( par1EntityPlayer.inventory.currentItem, (ItemStack) null); } if (!this.worldObj.isRemote) { if (this.rand.nextInt(3) == 0) { this.setTamed(true); this.setPathToEntity((PathEntity) null); this.setAttackTarget((EntityLivingBase) null); this.setTarget(null); this.setOwner(par1EntityPlayer.getCommandSenderName()); this.playTameEffect(true); } else { this.playTameEffect(false); this.worldObj.setEntityState(this, (byte) 6); } } return true; } } return super.interact(par1EntityPlayer); } /** * This function is used when two same-species animals in 'love mode' breed * to generate the new baby animal. */ public EntityEnderChicken spawnBabyAnimal(EntityAgeable par1EntityAgeable) { EntityEnderChicken entitybluechicken = new EntityEnderChicken( this.worldObj); String s = this.getOwnerName(); if (s != null && s.trim().length() > 0) { entitybluechicken.setOwner(s); entitybluechicken.setTamed(true); } return entitybluechicken; } /** * Checks if the parameter is an item which this animal can be fed to breed * it (wheat, carrots or seeds depending on the animal type) */ public boolean isBreedingItem(ItemStack par1ItemStack) { if (this.isTamed()) { return par1ItemStack != null && par1ItemStack.itemID == Item.eyeOfEnder.itemID; } else { return false; } } public EntityAgeable createChild(EntityAgeable par1EntityAgeable) { return this.spawnBabyAnimal(par1EntityAgeable); } public boolean isScreaming() { return this.dataWatcher.getWatchableObjectByte(18) > 0; } public void setScreaming(boolean par1) { this.dataWatcher.updateObject(18, Byte.valueOf((byte) (par1 ? 1 : 0))); } protected boolean teleportRandomly() { if (!this.isTamed()) { double d0 = this.posX + (this.rand.nextDouble() - 0.5D) * 64.0D; double d1 = this.posY + (double) (this.rand.nextInt(64) - 32); double d2 = this.posZ + (this.rand.nextDouble() - 0.5D) * 64.0D; MinecraftServer.getServer().getLogAgent() .logInfo("X:" + d0 + " Y:" + d1 + " Z:" + d2); return this.teleportTo(d0, d1, d2); } else { return false; } } protected boolean teleportToEntity(Entity par1Entity) { Vec3 vec3 = this.worldObj.getWorldVec3Pool().getVecFromPool( this.posX - par1Entity.posX, this.boundingBox.minY + (double) (this.height / 2.0F) - par1Entity.posY + (double) par1Entity.getEyeHeight(), this.posZ - par1Entity.posZ); vec3 = vec3.normalize(); double d0 = 16.0D; double d1 = this.posX + (this.rand.nextDouble() - 0.5D) * 8.0D - vec3.xCoord * d0; double d2 = this.posY + (double) (this.rand.nextInt(16) - - vec3.yCoord * d0; double d3 = this.posZ + (this.rand.nextDouble() - 0.5D) * 8.0D - vec3.zCoord * d0; return this.teleportTo(d1, d2, d3); } protected boolean teleportTo(double par1, double par3, double par5) { EnderTeleportEvent event = new EnderTeleportEvent(this, par1, par3, par5, 0); if (MinecraftForge.EVENT_BUS.post(event)) { return false; } double d3 = this.posX; double d4 = this.posY; double d5 = this.posZ; this.posX = event.targetX; this.posY = event.targetY; this.posZ = event.targetZ; boolean flag = false; int i = MathHelper.floor_double(this.posX); int j = MathHelper.floor_double(this.posY); int k = MathHelper.floor_double(this.posZ); int l; if (this.worldObj.blockExists(i, j, k)) { boolean flag1 = false; while (!flag1 && j > 0) { l = this.worldObj.getBlockId(i, j - 1, k); if (l != 0 && Block.blocksList[l].blockMaterial.blocksMovement()) { flag1 = true; } else { --this.posY; --j; } } if (flag1) { this.setPosition(this.posX, this.posY, this.posZ); if (this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox).isEmpty() && !this.worldObj.isAnyLiquid(this.boundingBox)) { flag = true; } } } if (!flag) { this.setPosition(d3, d4, d5); return false; } else { short short1 = 128; for (l = 0; l < short1; ++l) { double d6 = (double) l / ((double) short1 - 1.0D); float f = (this.rand.nextFloat() - 0.5F) * 0.2F; float f1 = (this.rand.nextFloat() - 0.5F) * 0.2F; float f2 = (this.rand.nextFloat() - 0.5F) * 0.2F; double d7 = d3 + (this.posX - d3) * d6 + (this.rand.nextDouble() - 0.5D) * (double) this.width * 2.0D; double d8 = d4 + (this.posY - d4) * d6 + this.rand.nextDouble() * (double) this.height; double d9 = d5 + (this.posZ - d5) * d6 + (this.rand.nextDouble() - 0.5D) * (double) this.width * 2.0D; this.worldObj.spawnParticle("portal", d7, d8, d9, (double) f, (double) f1, (double) f2); } this.worldObj.playSoundEffect(d3, d4, d5, "mob.endermen.portal", 1.0F, 1.0F); this.playSound("mob.endermen.portal", 1.0F, 1.0F); return true; } } }
  3. So as the title says, I have added some new mobs to my mod, they do everything they're suppose to do except spawn. i somehow managed to get one of them to start spawning, but i have no idea how. but the one i managed to get to spawn isnt spawning in the end like it should. One of the others keeps trying to spawn a 0,0,0 and the third just simply does not spawn. here is the spawning code: EntityRegistry.addSpawn(EntityDiamondChicken.class, 5, 1, 2, EnumCreatureType.creature, BiomeGenBase.beach, BiomeGenBase.extremeHills, BiomeGenBase.extremeHillsEdge, BiomeGenBase.forest, BiomeGenBase.forestHills, BiomeGenBase.jungle, BiomeGenBase.jungleHills, BiomeGenBase.mushroomIsland, BiomeGenBase.mushroomIslandShore, BiomeGenBase.ocean, BiomeGenBase.plains, BiomeGenBase.river, BiomeGenBase.swampland); EntityRegistry.addSpawn(EntityCoalChicken.class, 10, 1, 5, EnumCreatureType.creature, BiomeGenBase.beach, BiomeGenBase.extremeHills, BiomeGenBase.extremeHillsEdge, BiomeGenBase.forest, BiomeGenBase.forestHills, BiomeGenBase.jungle, BiomeGenBase.jungleHills, BiomeGenBase.mushroomIsland, BiomeGenBase.mushroomIslandShore, BiomeGenBase.ocean, BiomeGenBase.plains, BiomeGenBase.river, BiomeGenBase.swampland); EntityRegistry.addSpawn(EntityIronChicken.class, 9, 1, 3, EnumCreatureType.creature, BiomeGenBase.beach, BiomeGenBase.extremeHills, BiomeGenBase.extremeHillsEdge, BiomeGenBase.forest, BiomeGenBase.forestHills, BiomeGenBase.jungle, BiomeGenBase.jungleHills, BiomeGenBase.mushroomIsland, BiomeGenBase.mushroomIslandShore, BiomeGenBase.ocean, BiomeGenBase.plains, BiomeGenBase.river, BiomeGenBase.swampland); EntityRegistry.addSpawn(EntityGoldChicken.class, 7, 1, 2, EnumCreatureType.creature, BiomeGenBase.beach, BiomeGenBase.extremeHills, BiomeGenBase.extremeHillsEdge, BiomeGenBase.forest, BiomeGenBase.forestHills, BiomeGenBase.jungle, BiomeGenBase.jungleHills, BiomeGenBase.mushroomIsland, BiomeGenBase.mushroomIslandShore, BiomeGenBase.ocean, BiomeGenBase.plains, BiomeGenBase.river, BiomeGenBase.swampland); EntityRegistry.addSpawn(EntityLapisChicken.class, 7, 1, 2, EnumCreatureType.creature, BiomeGenBase.beach, BiomeGenBase.extremeHills, BiomeGenBase.extremeHillsEdge, BiomeGenBase.forest, BiomeGenBase.forestHills, BiomeGenBase.jungle, BiomeGenBase.jungleHills, BiomeGenBase.mushroomIsland, BiomeGenBase.mushroomIslandShore, BiomeGenBase.ocean, BiomeGenBase.plains, BiomeGenBase.river, BiomeGenBase.swampland); EntityRegistry.addSpawn(EntityRedstoneChicken.class, 6, 1, 2, EnumCreatureType.creature, BiomeGenBase.beach, BiomeGenBase.extremeHills, BiomeGenBase.extremeHillsEdge, BiomeGenBase.forest, BiomeGenBase.forestHills, BiomeGenBase.jungle, BiomeGenBase.jungleHills, BiomeGenBase.mushroomIsland, BiomeGenBase.mushroomIslandShore, BiomeGenBase.ocean, BiomeGenBase.plains, BiomeGenBase.river, BiomeGenBase.swampland); EntityRegistry.addSpawn(EntityEmeraldChicken.class, 5, 1, 2, EnumCreatureType.creature, BiomeGenBase.beach, BiomeGenBase.extremeHills, BiomeGenBase.extremeHillsEdge, BiomeGenBase.forest, BiomeGenBase.forestHills, BiomeGenBase.jungle, BiomeGenBase.jungleHills, BiomeGenBase.mushroomIsland, BiomeGenBase.mushroomIslandShore, BiomeGenBase.ocean, BiomeGenBase.plains, BiomeGenBase.river, BiomeGenBase.swampland); EntityRegistry.addSpawn(EntitySkeletonChicken.class, 10, 1, 2, EnumCreatureType.monster, BiomeGenBase.beach, BiomeGenBase.extremeHills, BiomeGenBase.extremeHillsEdge, BiomeGenBase.forest, BiomeGenBase.forestHills, BiomeGenBase.jungle, BiomeGenBase.jungleHills, BiomeGenBase.mushroomIsland, BiomeGenBase.mushroomIslandShore, BiomeGenBase.ocean, BiomeGenBase.plains, BiomeGenBase.river, BiomeGenBase.swampland); EntityRegistry.addSpawn(EntityEnderChicken.class, 3, 1, 2, EnumCreatureType.creature, BiomeGenBase.beach, BiomeGenBase.extremeHills, BiomeGenBase.extremeHillsEdge, BiomeGenBase.forest, BiomeGenBase.forestHills, BiomeGenBase.jungle, BiomeGenBase.jungleHills, BiomeGenBase.mushroomIsland, BiomeGenBase.mushroomIslandShore, BiomeGenBase.ocean, BiomeGenBase.plains, BiomeGenBase.river, BiomeGenBase.swampland); >EntityRegistry.addSpawn(EntityEnderChicken.class, 10, 1, 2, EnumCreatureType.creature, BiomeGenBase.sky); >>EntityRegistry.addSpawn(EntityCookieChicken.class, 6, 1, 2, EnumCreatureType.creature, BiomeGenBase.beach, BiomeGenBase.extremeHills, BiomeGenBase.extremeHillsEdge, BiomeGenBase.forest, BiomeGenBase.forestHills, BiomeGenBase.jungle, BiomeGenBase.jungleHills, BiomeGenBase.mushroomIsland, BiomeGenBase.mushroomIslandShore, BiomeGenBase.ocean, BiomeGenBase.plains, BiomeGenBase.river, BiomeGenBase.swampland); >>>EntityRegistry.addSpawn(EntityGiantChicken.class, 4, 1, 2, EnumCreatureType.creature, BiomeGenBase.beach, BiomeGenBase.extremeHills, BiomeGenBase.extremeHillsEdge, BiomeGenBase.forest, BiomeGenBase.forestHills, BiomeGenBase.jungle, BiomeGenBase.jungleHills, BiomeGenBase.mushroomIsland, BiomeGenBase.mushroomIslandShore, BiomeGenBase.ocean, BiomeGenBase.plains, BiomeGenBase.river, BiomeGenBase.swampland); I know that all the mobs are registered into the game because i can spawn them with an egg, but they dont seem to want to spawn naturally. The line with ">" is the one that is suppose to spawn in the end, but never does. The live with ">>" is the one that keeps trying to spawn at 0,0,0 The line with ">>>" is the one that never spawns I do have a logger set up with each of the mobs to check when they try to spawn and where. The ender chicken i have yet to see a spawn log for, but have seen several teleport logs that i forgot to take out. the cookie chicken always tells me that its trying to spawn at 0,0,0. and the giant chicken just never shows a log. There are no errors that show up either. Does anyone know what could be causing this?
  4. i do not know what could be causing that, but i thought id just give my 2 cents and say that the frosted glass look, looks pretty cool on that.
  5. ok, thanks i dont know why i didnt think of that . by the time im done with this mod im going to be a mob expert lol.
  6. so as part of my mod i'm adding a chicken that is 3 times the size of a normal chicken, but the problem is that the hit box is remaining the normal size, and im not sure how to go about changing the size of it. Here is my code: a lot of the code in the entity class is place holder for now. could someone please show me where it sets the size of the hitbox?
  7. tried multiple constructors and it still didnt work, so i decided just to make another AI class to deal with meta blocks which now works. package mods.mochickens.misc; import net.minecraft.entity.EntityCreature; import net.minecraft.entity.ai.EntityAIBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.server.MinecraftServer; public class ChickAITemptDye extends EntityAIBase { /** The entity using this AI that is tempted by the player. */ private EntityCreature temptedEntity; private double field_75282_b; /** X position of player tempting this mob */ private double targetX; /** Y position of player tempting this mob */ private double targetY; /** Z position of player tempting this mob */ private double targetZ; private double field_75278_f; private double field_75279_g; /** The player that is tempting the entity that is using this AI. */ private EntityPlayer temptingPlayer; /** * A counter that is decremented each time the shouldExecute method is * called. The shouldExecute method will always return false if * delayTemptCounter is greater than 0. */ private int delayTemptCounter; /** True if this EntityAITempt task is running */ private boolean isRunning; /** * This field saves the ID of the items that can be used to breed entities * with this behaviour. */ private String breedingFood; /** * Whether the entity using this AI will be scared by the tempter's sudden * movement. */ private boolean scaredByPlayerMovement; private boolean field_75286_m; public ChickAITemptDye(EntityCreature par1EntityCreature, double par2, String par4, boolean par5) { this.setTemptedEntity(par1EntityCreature); this.field_75282_b = par2; this.setBreedingFood(par4); this.scaredByPlayerMovement = par5; this.setMutexBits(3); } /** * Returns whether the EntityAIBase should begin execution. */ public boolean shouldExecute() { String owner = this.getTemptedEntity().getDataWatcher() .getWatchableObjectString(17); if (this.getDelayTemptCounter() > 0) { this.setDelayTemptCounter(this.getDelayTemptCounter() - 1); return false; } else { this.setTemptingPlayer(this.getTemptedEntity().worldObj .getClosestPlayerToEntity(this.getTemptedEntity(), 10.0D)); if (this.getTemptingPlayer() == null) { return false; } else if (this.getTemptingPlayer().getEntityName() != owner) { return false; } else { ItemStack itemstack = this.getTemptingPlayer() .getCurrentEquippedItem(); return itemstack == null ? false : itemstack.getDisplayName().equalsIgnoreCase(this.getBreedingFood()); } } } /** * Returns whether an in-progress EntityAIBase should continue executing */ public boolean continueExecuting() { if (this.scaredByPlayerMovement) { if (this.getTemptedEntity().getDistanceSqToEntity( this.getTemptingPlayer()) < 36.0D) { if (this.getTemptingPlayer().getDistanceSq(this.targetX, this.targetY, this.targetZ) > 0.010000000000000002D) { return false; } if (Math.abs((double) this.getTemptingPlayer().rotationPitch - this.field_75278_f) > 5.0D || Math.abs((double) this.getTemptingPlayer().rotationYaw - this.field_75279_g) > 5.0D) { return false; } } else { this.targetX = this.getTemptingPlayer().posX; this.targetY = this.getTemptingPlayer().posY; this.targetZ = this.getTemptingPlayer().posZ; } this.field_75278_f = (double) this.getTemptingPlayer().rotationPitch; this.field_75279_g = (double) this.getTemptingPlayer().rotationYaw; } return this.shouldExecute(); } /** * Execute a one shot task or start executing a continuous task */ public void startExecuting() { this.targetX = this.getTemptingPlayer().posX; this.targetY = this.getTemptingPlayer().posY; this.targetZ = this.getTemptingPlayer().posZ; this.isRunning = true; this.field_75286_m = this.getTemptedEntity().getNavigator() .getAvoidsWater(); this.getTemptedEntity().getNavigator().setAvoidsWater(false); } /** * Resets the task */ public void resetTask() { this.setTemptingPlayer(null); this.getTemptedEntity().getNavigator().clearPathEntity(); this.setDelayTemptCounter(100); this.isRunning = false; this.getTemptedEntity().getNavigator() .setAvoidsWater(this.field_75286_m); } /** * Updates the task */ public void updateTask() { this.getTemptedEntity() .getLookHelper() .setLookPositionWithEntity(this.getTemptingPlayer(), 30.0F, (float) this.getTemptedEntity().getVerticalFaceSpeed()); if (this.getTemptedEntity().getDistanceSqToEntity( this.getTemptingPlayer()) < 6.25D) { this.getTemptedEntity().getNavigator().clearPathEntity(); } else { this.getTemptedEntity() .getNavigator() .tryMoveToEntityLiving(this.getTemptingPlayer(), this.field_75282_b); } } /** * @see #isRunning */ public boolean isRunning() { return this.isRunning; } public int getDelayTemptCounter() { return delayTemptCounter; } public void setDelayTemptCounter(int delayTemptCounter) { this.delayTemptCounter = delayTemptCounter; } public EntityPlayer getTemptingPlayer() { return temptingPlayer; } public void setTemptingPlayer(EntityPlayer temptingPlayer) { this.temptingPlayer = temptingPlayer; } public EntityCreature getTemptedEntity() { return temptedEntity; } public void setTemptedEntity(EntityCreature temptedEntity) { this.temptedEntity = temptedEntity; } public String getBreedingFood() { return breedingFood; } public void setBreedingFood(String par4) { this.breedingFood = par4; } }
  8. this IS my own, i had to do it customize a few things in it. i could probably change it around a bit more, though if i dont want to do that if i dont have to. thats why i came here and asked.
  9. the constructor asks for an int, i can change that if i wanted, but i would have to change several other classes to match it, as for it not caring, thats because it simply is just that, unless there is a way, it doesnt care, and any dye will do what im trying to do, but i only want the cocoa beans to be used. heres the code for EntityAIChick: package mods.mochickens.misc; import net.minecraft.entity.EntityCreature; import net.minecraft.entity.ai.EntityAIBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; public class ChickAITempt extends EntityAIBase { /** The entity using this AI that is tempted by the player. */ private EntityCreature temptedEntity; private double field_75282_b; /** X position of player tempting this mob */ private double targetX; /** Y position of player tempting this mob */ private double targetY; /** Z position of player tempting this mob */ private double targetZ; private double field_75278_f; private double field_75279_g; /** The player that is tempting the entity that is using this AI. */ private EntityPlayer temptingPlayer; /** * A counter that is decremented each time the shouldExecute method is called. The shouldExecute method will always * return false if delayTemptCounter is greater than 0. */ private int delayTemptCounter; /** True if this EntityAITempt task is running */ private boolean isRunning; /** * This field saves the ID of the items that can be used to breed entities with this behaviour. */ private int breedingFood; /** * Whether the entity using this AI will be scared by the tempter's sudden movement. */ private boolean scaredByPlayerMovement; private boolean field_75286_m; public ChickAITempt(EntityCreature par1EntityCreature, double par2, int par4, boolean par5) { this.setTemptedEntity(par1EntityCreature); this.field_75282_b = par2; this.setBreedingFood(par4); this.scaredByPlayerMovement = par5; this.setMutexBits(3); } /** * Returns whether the EntityAIBase should begin execution. */ public boolean shouldExecute() { String owner = this.getTemptedEntity().getDataWatcher() .getWatchableObjectString(17); if (this.getDelayTemptCounter() > 0) { this.setDelayTemptCounter(this.getDelayTemptCounter() - 1); return false; } else { this.setTemptingPlayer(this.getTemptedEntity().worldObj .getClosestPlayerToEntity(this.getTemptedEntity(), 10.0D)); if (this.getTemptingPlayer() == null) { return false; } else if (this.getTemptingPlayer().getEntityName() != owner) { return false; } else { ItemStack itemstack = this.getTemptingPlayer() .getCurrentEquippedItem(); return itemstack == null ? false : itemstack.itemID == this .getBreedingFood(); } } } /** * Returns whether an in-progress EntityAIBase should continue executing */ public boolean continueExecuting() { if (this.scaredByPlayerMovement) { if (this.getTemptedEntity().getDistanceSqToEntity(this.getTemptingPlayer()) < 36.0D) { if (this.getTemptingPlayer().getDistanceSq(this.targetX, this.targetY, this.targetZ) > 0.010000000000000002D) { return false; } if (Math.abs((double)this.getTemptingPlayer().rotationPitch - this.field_75278_f) > 5.0D || Math.abs((double)this.getTemptingPlayer().rotationYaw - this.field_75279_g) > 5.0D) { return false; } } else { this.targetX = this.getTemptingPlayer().posX; this.targetY = this.getTemptingPlayer().posY; this.targetZ = this.getTemptingPlayer().posZ; } this.field_75278_f = (double)this.getTemptingPlayer().rotationPitch; this.field_75279_g = (double)this.getTemptingPlayer().rotationYaw; } return this.shouldExecute(); } /** * Execute a one shot task or start executing a continuous task */ public void startExecuting() { this.targetX = this.getTemptingPlayer().posX; this.targetY = this.getTemptingPlayer().posY; this.targetZ = this.getTemptingPlayer().posZ; this.isRunning = true; this.field_75286_m = this.getTemptedEntity().getNavigator().getAvoidsWater(); this.getTemptedEntity().getNavigator().setAvoidsWater(false); } /** * Resets the task */ public void resetTask() { this.setTemptingPlayer(null); this.getTemptedEntity().getNavigator().clearPathEntity(); this.setDelayTemptCounter(100); this.isRunning = false; this.getTemptedEntity().getNavigator().setAvoidsWater(this.field_75286_m); } /** * Updates the task */ public void updateTask() { this.getTemptedEntity().getLookHelper().setLookPositionWithEntity(this.getTemptingPlayer(), 30.0F, (float)this.getTemptedEntity().getVerticalFaceSpeed()); if (this.getTemptedEntity().getDistanceSqToEntity(this.getTemptingPlayer()) < 6.25D) { this.getTemptedEntity().getNavigator().clearPathEntity(); } else { this.getTemptedEntity().getNavigator().tryMoveToEntityLiving(this.getTemptingPlayer(), this.field_75282_b); } } /** * @see #isRunning */ public boolean isRunning() { return this.isRunning; } public int getDelayTemptCounter() { return delayTemptCounter; } public void setDelayTemptCounter(int delayTemptCounter) { this.delayTemptCounter = delayTemptCounter; } public EntityPlayer getTemptingPlayer() { return temptingPlayer; } public void setTemptingPlayer(EntityPlayer temptingPlayer) { this.temptingPlayer = temptingPlayer; } public EntityCreature getTemptedEntity() { return temptedEntity; } public void setTemptedEntity(EntityCreature temptedEntity) { this.temptedEntity = temptedEntity; } public int getBreedingFood() { return breedingFood; } public void setBreedingFood(int breedingFood) { this.breedingFood = breedingFood; } }
  10. Heres the code i need help with: this.tasks.addTask(3, new ChickAITempt(this, 1.0D, new ItemStack(Item.dyePowder, 1, 3).itemID, false)); i need to pass new ItemStack(Item.dyePowder, 1, 3).itemID on to ChickAITempt with the metadata of 3. but i cant get it to send without changing the constructor of ChickAITempt, which will break it with all the other mobs. could someone show me what i need to do to send the metadata to the ChickAITempt class?
  11. my bad, his is right i havent done this new texture system much so i gave you what i thought i remembered. Oops! good luck with your mod!
  12. should probably tag on that the path i gave you is for if your still using the IDE otherwise if your going to release it, put it in your mods folder so it would read in from the .minecraft folder "mods/YourModNameHere.zip/YourModNameHere/assets/textures" this path can change depending on how you had your mods path in Eclipse set up. eg. if in Eclipse its mods.YourModNameHere the path would change to "mods/YourModNameHere.zip/mods/YourModNameHere/assets/textures"
  13. with 1.6.4 your textures need to go in "src/minecraft/assets/YourModNameHere/textures" and from there i split it into mobs, items, and blocks.
  14. take public final static Block AdobeHalfSlab = new AdobeHalfSlab(501, false, Material.rock).setHardness(2.0F).setResistance(10.0F).setStepSound(Block.soundStoneFootstep).setUnlocalizedName("AdobeHalfSlab").setCreativeTab(CreativeTabs.tabBlock).setTextureName(AdobeInfo.NAME.toLowerCase() + ":adobe_block"); and change the texture name to something like (AdobeInfo.Test.toLowerCase() + ":adobe_block") and see what the name says, my guess is that the name showing is coming from that section for some reason.
  15. no problem, im not a professional coder, but i know its one of those kinds of mistakes that even they make good luck with the rest of your mod!
  16. your RoseGoldBlock ID is way past the max allowable id. my guess is that you put an extra 0 in there by accedent. so instead of 10014 put 1014 when you get an error read through it and check for your classes and cross check the lines, when you find the line it mentions try to play around with the line a bit and see if you can figure it out. and for future reference the max block id is 4096
  17. Ive been trying to look into the spawning rates of vanilla mobs but i have run into a dead end. I found where they are added in EntityList but their spawn rates are not set there. The reason i am looking for the spawn rates is that i have noticed that my mobs, no matter what i set their spawn rates to, rarely ever spawn. I heard that 10D is about the same spawn rate as a creeper, but even if i use that my mob rarely ever spawns. Could someone point me to the class where their spawns are set?
  18. I have not done this myself, so i do not know how to do it, but as a modder i can say, you already have what you need to do this, look at potion.java and see what the confusion potion calls, then check the exact code it is calling, the potion effect may call 2 different things, if that is the case then you can copy the call for yhe camera effect and get the result your looking for, though by doing it this way, you lose the ability to customize exactly how it looks.
  19. I archived the folder to a zip and it started giving the noClassFound error which i was happy to see, so i moved my files around a bit and it works now, thanks for the help.
  20. So after several posts here and a lot of time spent modifying the code for each mob to what i wanted, i can finally release it, but i have run into one problem, i have recompiled it and reobfuscated it, i have watched Wuppy's tutorial on 1.6.* how to release your mod, and none of that has worked. Here is the error this error gives me no leads as to what i need to do. my mod name file is moChickens1.6.4V1.0.rar all other mods are loading like they should, but this is the only one that isnt loading. file path: mod/1.6.4/moChickens1.6.4V1.0.rar has anyone seen this error before? or does anyone know how to fix this error? any help would be greatly appreciated. if therres anything you need to know that i didnt share, let me know and i will post it as soon as i can.
  21. I have played around with this concept a bit recently and figured out, for it to attack a mob you have to have BOTH the collision task and the attackable task so you have to have both these: this.tasks.addTask(2, new EntityAIAttackOnCollide(this, EntityCow.class, 1.0D, true)); this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityCow.class, 0, false)); try that, i imagine that is you problem.
  22. you should look into using techne for modeling, its what many modders use to make mob models and block models. http://techne.zeux.me/
  23. @diesieben07: i use audacity @GotoLink: Thank you, that was the problem. i wasnt fully understanding the file path, though i thought i was. i changed the file path to that, and now it works.
  24. here is the error i get by using that: the only change is on this on line: this.worldObj.playSoundAtEntity(this, "mochickens:sounds.layDiamond", 1.0F, 1.0F);
×
×
  • Create New...

Important Information

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