• 0

    posted a message on Making mobs jump at the player like spiders
    lol welp I figured it out. for anyone who is trying to do the same thing paste this into your mobs file:
    protected void attackEntity(Entity par1Entity, float par2)
        {
    	    float f = getEntityBrightness(1.0F);
    	    if (f > 0.5F && rand.nextInt(100) == 0)
    	    {
    		    entityToAttack = null;
    		    return;
    	    }
    	    if (par2 > 2.0F && par2 < 6F && rand.nextInt(10) == 0)
    	    {
    		    if (onGround)
    		    {
    			    double d = par1Entity.posX - posX;
    			    double d1 = par1Entity.posZ - posZ;
    			    float f1 = MathHelper.sqrt_double(d * d + d1 * d1);
    			    motionX = (d / (double)f1) * 0.5D * 0.8D + motionX * 0.2D;
    			    motionZ = (d1 / (double)f1) * 0.5D * 0.8D + motionZ * 0.2D;
    			    motionY = 0.4D;
    		    }
    	    }
    	    else
    	    {
    		    super.attackEntity(par1Entity, par2);
    	    }
        }
    Posted in: Modification Development
  • 0

    posted a message on Making mobs jump at the player like spiders
    Edit: I figured it out but now I'd like to increase the length and height of the jump. Anyone know what I have to modify in the code below to adjust this?
    Posted in: Modification Development
  • 0

    posted a message on [1.6.2] Click Mining Fix Fix - Speed up all mining everywhere
    This deserves more recognition.
    Posted in: Minecraft Mods
  • 0

    posted a message on Is there a recipe ingredient limit?
    wow, **** commas.
    Posted in: Modification Development
  • 0

    posted a message on Is there a recipe ingredient limit?
    My mod returns tons of errors when I try to use more than 2 ingredients per recipe. If I limit it to two ingredients it recompiles just fine. Is there a limit to how many ingredients you can use in a recipe or am I just doing something wrong? Here's what my code looks like:

    ModLoader.addRecipe(new ItemStack(daemonitePick, 1), new Object[]
    				{
    					"CDC", "MDM", "ADA", 'A', adamantinePick, 'D', puredaemonSoul 'C', cobaltPick 'M', mithrilPick
    				});
    Posted in: Modification Development
  • 0

    posted a message on Can't mine obsidian after modifying itempickaxe
    Quote from TechGuy543

    I don't recommend editing ItemPickaxe. You should create your own ItemPickaxe and then make your changes in that. Just remember to make your tool class extend your new ItemNameherePickaxe.


    Do you recommend the same for files like enumtoolmaterial and enumarmormaterial?
    Posted in: Modification Development
  • 0

    posted a message on Can't mine obsidian after modifying itempickaxe
    I've modded in about 6 new tiers of tools and added them to itempickaxe.java and enumtoolmaterial. I haven't changed the obsidian code at all:
    if (par1Block == Block.obsidian)
    		{
    			return toolMaterial.getHarvestLevel() == 3;
    		}


    For some reason I can't mine it with any level of pickaxe, not even diamond. The only thing that solves this is if I remove the above line of code from itempickaxe. Does anyone have any idea why this is happening?
    Posted in: Modification Development
  • 0

    posted a message on making mobs spawn during the day
    Quote from -Reaper-

    Try this:
    public boolean getCanSpawnHere()
    				{
    								return true;
    				}


    Now mobs should spawn everyehere


    wow this worked dude! thank you so much. have some imaginary internet karma.
    Posted in: Modification Development
  • 0

    posted a message on making mobs spawn during the day
    Quote from -Reaper-

    This
    protected boolean isValidLightLevel()


    I have never worked with Mobs, but I'm quite sure. The other spawning condition is in EntityCreature.java and it is called getCanSpawnHere(). I think that changing this:

    public boolean getCanSpawnHere()
    		{
    				return isValidLightLevel() && super.getCanSpawnHere();
    		}


    to this:

    public boolean getCanSpawnHere()
    		{
    				return super.getCanSpawnHere();
    		}


    Should allow to spawn in the light. It would not prevent them from burning however.

    Hope it helps :)


    Hey I appreciate the help. Unfortunately it seems like it didn't work :(. What could be preventing them from spawning..
    Posted in: Modification Development
  • 0

    posted a message on making mobs spawn during the day
    Hi can someone please point me to the right bit of code in entitymob that I need to change so mobs can spawn during the day?

    package net.minecraft.src;
    import java.util.Random;
    public abstract class EntityMob extends EntityCreature implements IMob
    {
    	/** How much damage this mob's attacks deal */
    	protected int attackStrength;
    	public EntityMob(World par1World)
    	{
    		super(par1World);
    		attackStrength = 2;
    		experienceValue = 5;
    	}
    	/**
    	 * 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()
    	{
    		float f = getEntityBrightness(1.0F);
    		if (f > 1.0F)
    		{
    			entityAge += 2;
    		}
    		super.onLivingUpdate();
    	}
    	/**
    	 * Called to update the entity's position/logic.
    	 */
    	public void onUpdate()
    	{
    		super.onUpdate();
    		if (!worldObj.isRemote && worldObj.difficultySetting == 0)
    		{
    			setEntityDead();
    		}
    	}
    	/**
    	 * Finds the closest player within 16 blocks to attack, or null if this Entity isn't interested in attacking
    	 * (Animals, Spiders at day, peaceful PigZombies).
    	 */
    	protected Entity findPlayerToAttack()
    	{
    		EntityPlayer entityplayer = worldObj.getClosestVulnerablePlayerToEntity(this, 32D);
    		if (entityplayer != null && canEntityBeSeen(entityplayer))
    		{
    			return entityplayer;
    		}
    		else
    		{
    			return null;
    		}
    	}
    	/**
    	 * Called when the entity is attacked.
    	 */
    	public boolean attackEntityFrom(DamageSource par1DamageSource, int par2)
    	{
    		if (super.attackEntityFrom(par1DamageSource, par2))
    		{
    			Entity entity = par1DamageSource.getEntity();
    			if (riddenByEntity == entity || ridingEntity == entity)
    			{
    				return true;
    			}
    			if (entity != this)
    			{
    				entityToAttack = entity;
    			}
    			return true;
    		}
    		else
    		{
    			return false;
    		}
    	}
    	public boolean attackEntityAsMob(Entity par1Entity)
    	{
    		int i = attackStrength;
    		if (isPotionActive(Potion.damageBoost))
    		{
    			i += 3 << getActivePotionEffect(Potion.damageBoost).getAmplifier();
    		}
    		if (isPotionActive(Potion.weakness))
    		{
    			i -= 2 << getActivePotionEffect(Potion.weakness).getAmplifier();
    		}
    		return par1Entity.attackEntityFrom(DamageSource.causeMobDamage(this), i);
    	}
    	/**
    	 * Basic mob attack. Default to touch of death in EntityCreature. Overridden by each mob to define their attack.
    	 */
    	protected void attackEntity(Entity par1Entity, float par2)
    	{
    		if (attackTime <= 0 && par2 < 2.0F && par1Entity.boundingBox.maxY > boundingBox.minY && par1Entity.boundingBox.minY < boundingBox.maxY)
    		{
    			attackTime = 20;
    			attackEntityAsMob(par1Entity);
    		}
    	}
    	/**
    	 * Takes a coordinate in and returns a weight to determine how likely this creature will try to path to the block.
    	 * Args: x, y, z
    	 */
    	public float getBlockPathWeight(int par1, int par2, int par3)
    	{
    		return 0.5F - worldObj.getLightBrightness(par1, par2, par3);
    	}
    	/**
    	 * (abstract) Protected helper method to write subclass entity data to NBT.
    	 */
    	public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound)
    	{
    		super.writeEntityToNBT(par1NBTTagCompound);
    	}
    	/**
    	 * (abstract) Protected helper method to read subclass entity data from NBT.
    	 */
    	public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound)
    	{
    		super.readEntityFromNBT(par1NBTTagCompound);
    	}
    	/**
    	 * Checks to make sure the light is not too bright where the mob is spawning
    	 */
    	protected boolean isValidLightLevel()
    	{
    		int i = MathHelper.floor_double(posX);
    		int j = MathHelper.floor_double(boundingBox.minY);
    		int k = MathHelper.floor_double(posZ);
    		if (worldObj.getSavedLightValue(EnumSkyBlock.Sky, i, j, k) > rand.nextInt(100))
    		{
    			return false;
    		}
    		int l = worldObj.getBlockLightValue(i, j, k);
    		if (worldObj.isThundering())
    		{
    			int i1 = worldObj.skylightSubtracted;
    			worldObj.skylightSubtracted = 10;
    			l = worldObj.getBlockLightValue(i, j, k);
    			worldObj.skylightSubtracted = i1;
    		}
    		return l <= rand.nextInt(20);
    	}
    	/**
    	 * Checks if the entity's current position is a valid location to spawn this entity.
    	 */
    	public boolean getCanSpawnHere()
    	{
    		return isValidLightLevel() && super.getCanSpawnHere();
    	}
    }
    Posted in: Modification Development
  • 0

    posted a message on making mobs spawn during the day
    Hi can someone please point me to the right bit of code in entitymob that I need to change so mobs can spawn during the day?

    package net.minecraft.src;
    import java.util.Random;
    public abstract class EntityMob extends EntityCreature implements IMob
    {
        /** How much damage this mob's attacks deal */
        protected int attackStrength;
        public EntityMob(World par1World)
        {
    	    super(par1World);
    	    attackStrength = 2;
    	    experienceValue = 5;
        }
        /**
    	 * 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()
        {
    	    float f = getEntityBrightness(1.0F);
    	    if (f > 1.0F)
    	    {
    		    entityAge += 2;
    	    }
    	    super.onLivingUpdate();
        }
        /**
    	 * Called to update the entity's position/logic.
    	 */
        public void onUpdate()
        {
    	    super.onUpdate();
    	    if (!worldObj.isRemote && worldObj.difficultySetting == 0)
    	    {
    		    setEntityDead();
    	    }
        }
        /**
    	 * Finds the closest player within 16 blocks to attack, or null if this Entity isn't interested in attacking
    	 * (Animals, Spiders at day, peaceful PigZombies).
    	 */
        protected Entity findPlayerToAttack()
        {
    	    EntityPlayer entityplayer = worldObj.getClosestVulnerablePlayerToEntity(this, 32D);
    	    if (entityplayer != null && canEntityBeSeen(entityplayer))
    	    {
    		    return entityplayer;
    	    }
    	    else
    	    {
    		    return null;
    	    }
        }
        /**
    	 * Called when the entity is attacked.
    	 */
        public boolean attackEntityFrom(DamageSource par1DamageSource, int par2)
        {
    	    if (super.attackEntityFrom(par1DamageSource, par2))
    	    {
    		    Entity entity = par1DamageSource.getEntity();
    		    if (riddenByEntity == entity || ridingEntity == entity)
    		    {
    			    return true;
    		    }
    		    if (entity != this)
    		    {
    			    entityToAttack = entity;
    		    }
    		    return true;
    	    }
    	    else
    	    {
    		    return false;
    	    }
        }
        public boolean attackEntityAsMob(Entity par1Entity)
        {
    	    int i = attackStrength;
    	    if (isPotionActive(Potion.damageBoost))
    	    {
    		    i += 3 << getActivePotionEffect(Potion.damageBoost).getAmplifier();
    	    }
    	    if (isPotionActive(Potion.weakness))
    	    {
    		    i -= 2 << getActivePotionEffect(Potion.weakness).getAmplifier();
    	    }
    	    return par1Entity.attackEntityFrom(DamageSource.causeMobDamage(this), i);
        }
        /**
    	 * Basic mob attack. Default to touch of death in EntityCreature. Overridden by each mob to define their attack.
    	 */
        protected void attackEntity(Entity par1Entity, float par2)
        {
    	    if (attackTime <= 0 && par2 < 2.0F && par1Entity.boundingBox.maxY > boundingBox.minY && par1Entity.boundingBox.minY < boundingBox.maxY)
    	    {
    		    attackTime = 20;
    		    attackEntityAsMob(par1Entity);
    	    }
        }
        /**
    	 * Takes a coordinate in and returns a weight to determine how likely this creature will try to path to the block.
    	 * Args: x, y, z
    	 */
        public float getBlockPathWeight(int par1, int par2, int par3)
        {
    	    return 0.5F - worldObj.getLightBrightness(par1, par2, par3);
        }
        /**
    	 * (abstract) Protected helper method to write subclass entity data to NBT.
    	 */
        public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound)
        {
    	    super.writeEntityToNBT(par1NBTTagCompound);
        }
        /**
    	 * (abstract) Protected helper method to read subclass entity data from NBT.
    	 */
        public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound)
        {
    	    super.readEntityFromNBT(par1NBTTagCompound);
        }
        /**
    	 * Checks to make sure the light is not too bright where the mob is spawning
    	 */
        protected boolean isValidLightLevel()
        {
    	    int i = MathHelper.floor_double(posX);
    	    int j = MathHelper.floor_double(boundingBox.minY);
    	    int k = MathHelper.floor_double(posZ);
    	    if (worldObj.getSavedLightValue(EnumSkyBlock.Sky, i, j, k) > rand.nextInt(100))
    	    {
    		    return false;
    	    }
    	    int l = worldObj.getBlockLightValue(i, j, k);
    	    if (worldObj.isThundering())
    	    {
    		    int i1 = worldObj.skylightSubtracted;
    		    worldObj.skylightSubtracted = 10;
    		    l = worldObj.getBlockLightValue(i, j, k);
    		    worldObj.skylightSubtracted = i1;
    	    }
    	    return l <= rand.nextInt(20);
        }
        /**
    	 * Checks if the entity's current position is a valid location to spawn this entity.
    	 */
        public boolean getCanSpawnHere()
        {
    	    return isValidLightLevel() && super.getCanSpawnHere();
        }
    }
    Posted in: Mods Discussion
  • 0

    posted a message on Metallurgy - Putting the "Mine" back in "Minecraft"!
    Quote from Shadowclaimer

    That would require thousands of extra variables and flood the config file, it'd be a TON of grunt work for me to implement that and would probably bloat the code beyond all recognition. I put my money on it won't be happening.


    Oh well not a problem. I really like your item sprites btw they look very cool.
    Posted in: Minecraft Mods
  • 0

    posted a message on Metallurgy - Putting the "Mine" back in "Minecraft"!
    can you control tool speed and durability in the config ile?
    Posted in: Minecraft Mods
  • 0

    posted a message on [DISCONTINUED] 1.3.2 [SSP][Forge] TFC's Gem Pack! 8 New Materials! (Now with a Slingshot!) -25 New Achievements-
    I'm using 2.0 btw and I tried it with 2.3 and it works. I'm guessing the problem is because I'm not using forge? Here's something from modloader:
    java.lang.Exception: No more empty item sprite indices left!
    at ModLoader.getUniqueItemSpriteIndex(ModLoader.java:707)
    at ModLoader.getUniqueSpriteIndex(ModLoader.java:718)
    at ModLoader.addOverride(ModLoader.java:356)
    at mod_Invasion.<clinit>(mod_Invasion.java:1053)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at java.lang.Class.newInstance0(Unknown Source)
    at java.lang.Class.newInstance(Unknown Source)
    at ModLoader.addMod(ModLoader.java:293)
    at ModLoader.readFromClassPath(ModLoader.java:1217)
    at ModLoader.init(ModLoader.java:885)
    at ModLoader.addAllRenderers(ModLoader.java:186)
    at aho.<init>(aho.java:79)
    at aho.<clinit>(aho.java:9)
    at net.minecraft.client.Minecraft.a(Minecraft.java:395)
    at net.minecraft.client.Minecraft.run(Minecraft.java:732)
    at java.lang.Thread.run(Unknown Source)
    Posted in: Minecraft Mods
  • To post a comment, please .