• 0

    posted a message on ♛[1.6.2] Adventure-Craft ★ [Hardcore Factions PvP] ★ [No Lag] ★ [PvP Enhancing Plugins] ★ [Great Staff]♛
    Unknown host? Can't resolve Host name?
    What the hell? I was log in for about a hour ago, and now it won't work? Does it work for anybody else?
    Posted in: PC Servers
  • 0

    posted a message on TechGuy's Modding Tutorials
    Quote from IP_Programs

    how do you make a npc human that is tameable, only becomes aggressive if you attack it, and attacks for you when tamed - like the wolf?

    I am no expert, but i think you should make it to extend EntityCreature, or EntityTameable. EntityCreature makes it friendly even if you hit it, don't know if it is like that for entitytameable(I have never made a tameable mob) No clue on how to make it tameable, but have a look in the class for wolf, and EntityTameable.
    Like I said above, I am not an expert, so don't get mad at me if it ****s it up, or won't work. Maybe backup if it is a big mod :)
    Posted in: Mapping and Modding Tutorials
  • 0

    posted a message on TechGuy's Modding Tutorials
    Quote from TechGuy543

    Try something like that in your entity class. Don't know if it will work though.

    public void onDeath(DamageSource par1DamageSource)
    {
    super.onDeath(par1DamageSource);

    if ((par1DamageSource.getSourceOfDamage() instanceof EntityPlayer))
    {
    EntityPlayer entityplayer = (EntityPlayer)par1DamageSource.getEntity();
    double d = entityplayer.posX - posX;
    double d1 = entityplayer.posZ - posZ;

    entityplayer.triggerAchievement(mod_***.achievementName);

    }
    }
    I try it out later, i notify you if it would work :)
    Posted in: Mapping and Modding Tutorials
  • 0

    posted a message on TechGuy's Modding Tutorials
    How can i make an achiviment like when i kill my self made mob?
    I have deleted everything i have tried, because it didn't work, so please don't ask about what i have done.
    Sorry if i could sound angry
    Posted in: Mapping and Modding Tutorials
  • 0

    posted a message on Help with adding Tools
    no one has the answer?
    Posted in: Modification Development
  • 0

    posted a message on Help with adding Tools
    Hey, i can't figure out how to add swords,shovels,axes or pickaxes into my mod.Can somebody who knows how to do this please reply, and if you got the time, please tell me what each part of the code means. I have deleted everything i have tried, so don't ask about my code. I want to know what i need to do from the scratch. I am using ModLoader just as you know
    Posted in: Modification Development
  • 0

    posted a message on How to generate a block in the nether/overworld+How to make tools [ModLoader]
    Quote from Jantomedes

    BUT, remember that this generate an ore. To generate for example a tower you need to use other code.

    I know that. I am going to make a structure later, and I am going to use this guy's tutorial(http://www.minecraftforum.net/topic/960286-techguys-modding-tutorials-5thapr2012/) on how to do it. He didn't have a generating ore tutorial so i posted a topic here
    Posted in: Modification Development
  • 0

    posted a message on How to generate a block in the nether/overworld+How to make tools [ModLoader]
    Quote from kamkam01

    Assuming you're using Modloader, the generation is fairly simple. The code for Overworld gen is this:
      public void generateSurface(World world, Random random, int chunkX, int chunkZ)
      {
       for(int a= 0; a < 20; a++)
       {
    	int randPosX = chunkX + random.nextInt(x);
    	int randPosY = random.nextInt(x);
    	int randPosZ = chunkZ + random.nextInt(x);
    	(new WorldGenMinable(mod_modname.blockname.blockID, howmanyinvein)).generate(world, random, randPosX, randPosY, randPosZ);
    	}
      }

    Where x (in the nextInt statements) in randPosX controls frequently it spawns, in randPosY controls how many blocks above bedrock it will spawn, and in randPosZ is practically the same as randPosX (I might be wrong there). The rest is fairly self explanitory.For nether generation, create WorldGenNether.java, and put this code in:
    package net.minecraft.src;
    import java.util.Random;
    public class WorldGenNether extends WorldGenerator
    {
    	/** The block ID of the ore to be placed using this generator. */
    	private int minableBlockId;
    	/** The number of blocks to generate. */
    	private int numberOfBlocks;
    	public WorldGenNether(int par1, int par2)
    	{
    		minableBlockId = par1;
    		numberOfBlocks = par2;
    	}
    	public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5)
    	{
    		float f = par2Random.nextFloat() * (float)Math.PI;
    		double d = (float)(par3 + 8) + (MathHelper.sin(f) * (float)numberOfBlocks) / 8F;
    		double d1 = (float)(par3 + 8) - (MathHelper.sin(f) * (float)numberOfBlocks) / 8F;
    		double d2 = (float)(par5 + 8) + (MathHelper.cos(f) * (float)numberOfBlocks) / 8F;
    		double d3 = (float)(par5 + 8) - (MathHelper.cos(f) * (float)numberOfBlocks) / 8F;
    		double d4 = (par4 + par2Random.nextInt(3)) - 2;
    		double d5 = (par4 + par2Random.nextInt(3)) - 2;
    		for (int i = 0; i <= numberOfBlocks; i++)
    		{
    			double d6 = d + ((d1 - d) * (double)i) / (double)numberOfBlocks;
    			double d7 = d4 + ((d5 - d4) * (double)i) / (double)numberOfBlocks;
    			double d8 = d2 + ((d3 - d2) * (double)i) / (double)numberOfBlocks;
    			double d9 = (par2Random.nextDouble() * (double)numberOfBlocks) / 16D;
    			double d10 = (double)(MathHelper.sin(((float)i * (float)Math.PI) / (float)numberOfBlocks) + 1.0F) * d9 + 1.0D;
    			double d11 = (double)(MathHelper.sin(((float)i * (float)Math.PI) / (float)numberOfBlocks) + 1.0F) * d9 + 1.0D;
    			int j = MathHelper.floor_double(d6 - d10 / 2D);
    			int k = MathHelper.floor_double(d7 - d11 / 2D);
    			int l = MathHelper.floor_double(d8 - d10 / 2D);
    			int i1 = MathHelper.floor_double(d6 + d10 / 2D);
    			int j1 = MathHelper.floor_double(d7 + d11 / 2D);
    			int k1 = MathHelper.floor_double(d8 + d10 / 2D);
    			for (int l1 = j; l1 <= i1; l1++)
    			{
    				double d12 = (((double)l1 + 0.5D) - d6) / (d10 / 2D);
    				if (d12 * d12 >= 1.0D)
    				{
    					continue;
    				}
    				for (int i2 = k; i2 <= j1; i2++)
    				{
    					double d13 = (((double)i2 + 0.5D) - d7) / (d11 / 2D);
    					if (d12 * d12 + d13 * d13 >= 1.0D)
    					{
    						continue;
    					}
    					for (int j2 = l; j2 <= k1; j2++)
    					{
    						double d14 = (((double)j2 + 0.5D) - d8) / (d10 / 2D);
    						if (d12 * d12 + d13 * d13 + d14 * d14 < 1.0D && par1World.getBlockId(l1, i2, j2) == Block.netherrack.blockID)
    						{
    							par1World.setBlock(l1, i2, j2, minableBlockId);
    						}
    					}
    				}
    			}
    		}
    		return true;
    	}
    }

    Then, just put this code in your mod file for nether generation.
    public void generateNether(World world, Random random, int chunkX, int chunkZ)
      {
       for(int a= 0; a < 20; a++)
       {
    	int randPosX = chunkX + random.nextInt(x);
    	int randPosY = random.nextInt(x);
    	int randPosZ = chunkZ + random.nextInt(x);
    	(new WorldGenNether(mod_modname.blockname.blockID, 40)).generate(world, random, randPosX, randPosY, randPosZ);
    	}
      }

    Hope I was of help!

    Thanks, I try it out soon.
    Looks like it's going to work, and thanks for saying what it means
    Posted in: Modification Development
  • 0

    posted a message on How to generate a block in the nether/overworld+How to make tools [ModLoader]
    Can someone please tell me on how to make a block generate in the nether and overworld, and maybe on how to make tools(sword,pickaxe,shovel and axe)
    I have all the pictures for the tools and the block(have registered the block already)
    If you know the code, and know what each part of it means, please tell me that too :)
    All help is appreciated
    Posted in: Modification Development
  • 0

    posted a message on TechGuy's Modding Tutorials
    What will happen when version 1.2.5 comes out, will you still make tutorials, or will you stop,and dø people need to use modloader then. Sorry my English is bad :P
    Posted in: Mapping and Modding Tutorials
  • 0

    posted a message on 1.2.5 Snapshot News - Modders Can Prepare Now
    Quote from CovertJaguar

    None, I repeat none, of the perquisites for mods even begin updating until the official update comes out. No one works off snapshots, nor would I want them to. I'd rather be behind than spend all my time updating.

    Even once the perquisites are updated its extremely tedious for us modders to setup a new dev environment and then we still have to fix any name or function changes.

    Nor am I particularly looking forward to the shakeup the Mod API will cause. Switching to it will probably require me to rewrite half my code, and the other half probably won't work without modding the Mod API. I imagine a lot of modders will stop modding.

    I just learned how to mod with modloader, and now i have to learn it all again?!
    I don't hope it will be so much different from what it is now
    Posted in: Minecraft News
  • 0

    posted a message on 1.2.5 Snapshot News - Modders Can Prepare Now
    Will it be totally different for modders, or will it be the same. I have just learned how to make my blocks into minecraft,items and NPCs, so i hope they don't change it so much
    Posted in: Minecraft News
  • 0

    posted a message on TechGuy's Modding Tutorials
    Quote from TechGuy543

    Add this to the constructor of your entity class:

    		getNavigator().setBreakDoors(true);
    		tasks.addTask(0, new EntityAISwimming(this));
    		tasks.addTask(1, new EntityAIBreakDoor(this));
    		tasks.addTask(2, new EntityAIAttackOnCollide(this, net.minecraft.src.EntityPlayer.class, moveSpeed, false));
    		tasks.addTask(3, new EntityAIAttackOnCollide(this, net.minecraft.src.EntityVillager.class, moveSpeed, true));
    		tasks.addTask(4, new EntityAIMoveTwardsRestriction(this, moveSpeed));
    		tasks.addTask(5, new EntityAIMoveThroughVillage(this, moveSpeed, false));
    		tasks.addTask(6, new EntityAIWander(this, moveSpeed));
    		tasks.addTask(7, new EntityAIWatchClosest(this, net.minecraft.src.EntityPlayer.class, 8F));
    		tasks.addTask(7, new EntityAILookIdle(this));
    		targetTasks.addTask(1, new EntityAIHurtByTarget(this, false));
    
    		targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, net.minecraft.src.EntityPlayer.class, 16F, 0, true));
    		targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, net.minecraft.src.EntityVillager.class, 16F, 0, false));


    Then this method anywhere else.

    	protected boolean isAIEnabled()
    	{
    		return true;
    	}


    Thanks it worked, but now i have another problem. I change his health to be 150, but it is still 20. What is the problem?
    EDIT: I got it to work :)
    Posted in: Mapping and Modding Tutorials
  • 0

    posted a message on TechGuy's Modding Tutorials
    What do i need to add to my HumanNpc code to make the npc to have the new AI?
    I can post my code if you want, but it is just like the human npc code like TechGuy made (Just that it extends EntityMob)
    He is a hostile mob, but he is just stupid like the old zombies, please reply someone!!!
    Posted in: Mapping and Modding Tutorials
  • 0

    posted a message on TechGuy's Modding Tutorials
    Can you make a tutorial on how to update MCP? (I don't want to lose my codes)
    If you know how to do it, please make a tutorial or reply to me :)
    Posted in: Mapping and Modding Tutorials
  • To post a comment, please or register a new account.