Jump to content

Help With Modding NPC's


noonzark

Recommended Posts

I need help every time i test my mod on eclipse it says Skipping Entity with id test or something like that this is my code. I hope someone can help

EntityTest.class

package net.minecraft.src;

import java.util.Random;

publicclass EntityTest extends EntityCreature

{

public EntityTest(World world)

{

super(world);

texture = "/Entity/Guy.png";

moveSpeed = 0.5F;

}

publicint getMaxHealth()

{

return 20;

}

protected String getLivingSound()

{

return"mob.villager.default";

}

protected String getHurtSound()

{

return"mob.villager.defaulthurt";

}

protected String getDeathSound()

{

return"mob.villager.defaultdeath";

}

protectedint getDropItemId()

{

return Item.ingotIron.shiftedIndex;

}

protectedboolean canDespawn()

{

returnfalse;

}

}

mod_Test.java

package net.minecraft.src;

import java.util.Map;

publicclass mod_Test extends BaseMod

{

publicvoid load()

{

ModLoader.registerEntityID(EntityTest.class, "Test", ModLoader.getUniqueEntityId());

ModLoader.addSpawn(EntityTest.class, 12, 14, 18, EnumCreatureType.creature);

}

publicvoid AddRenderer(Map map)

{

map.put(EntityTest.class, new RenderBiped(new ModelBiped(), 0.5F));

}

public String getVersion()

{

return"1.3.2";

}

}

Link to comment
Share on other sites

Eclipse says that or Minecraft says that? Post the text of the error and its context so it's clearer.

its eclipse, minecraft runs fine but now i got a new problem i changed EnumCreatureType.creature to Mob and now minecraft crashes heres my code if you want to help out

///////////////////////////////////EntityTest\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

package net.minecraft.src;

import java.util.Random;

public class EntityTest extends EntityMob

{

public EntityTest(World world)

{

super(world);

texture = "/Entity/Guy.png";

moveSpeed = 0.5F;

}

public int getMaxHealth()

{

return 20;

}

protected String getLivingSound()

{

return"mob.villager.default";

}

protected String getHurtSound()

{

return"mob.villager.defaulthurt";

}

protected String getDeathSound()

{

return"mob.villager.defaultdeath";

}

protected int getDropItemId()

{

return Item.ingotIron.shiftedIndex;

}

protected boolean canDespawn()

{

return false;

}

}

/////////////////////////////////////////////////////////////mod_Test\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

package net.minecraft.src;

import java.util.Map;

public class mod_Test extends BaseMod

{

public void load()

{

ModLoader.registerEntityID(EntityTest.class, "Test",

ModLoader.getUniqueEntityId());

ModLoader.addSpawn(EntityTest.class, 1, 1, 5, EnumCreatureType.monster);

}

public void addRenderer(Map map)

{

map.put(EntityTest.class, new RenderBiped(new ModelBiped(), 0.5F));

}

public String getVersion()

{

return "1.3.2";

}

}

Link to comment
Share on other sites

The way most good modders learn things is to figure out how Minecraft itself does it and then just do it the same way. After you do that a few times, you start to figure out how to change it to suit your ideas.

says the man who complains that the minecraft code is ass-backwards. I've looked at it once or twice, just out of curiosity and becasue i was considering making a mod. The way notch (and jeb) has written minecraft is just amazingly fucked up. I'm not that good of a programmer, but even I could see that he was making it do things that it didn't need to do, and in such convoluted ways. I haven't looked at the code since jeb did all that optimization to make things run faster, but i bet that alot of it was fixing all the screwed up code that notch put in.

Link to comment
Share on other sites

I haven't looked at the code since jeb did all that optimization to make things run faster, but i bet that alot of it was fixing all the screwed up code that notch put in.

Which is why the API is delayed yet again. Like I wouldn't put out a texture pack that looked like a 4-year-old with Down's fingerprinted it.

Link to comment
Share on other sites

You have to work within the framework of the game. No matter how much we all may complain about the ass-backwards coding, we still have to use that coding to do what we want, which means we often have to do things in the same ass-backward way ourselves. You can't just plug in clean code and expect it to function: You have to factor in all the little driblets of function dotted throughout the code-body.

The best way to learn the core of Minecraft is to study the core of Minecraft, and if that isn't possible for you yet, then you have a long way to go. I estimate almost 50% of my time spent modding so far has been grepping through the source code, tracing call-chains to figure out what in the fuck is going on, in order to leverage or recreate that functionality myself.

Link to comment
Share on other sites

And this is why I could never be a modder. I don't have the patience or attention span for it. Although, I might try working on the mod I wanted to make again, as I understand java a bit better now. Hopefully the modding api will make modding easier (read: fix the ass-backwards code). But I suspect that as usual with mojang, it will also be ass-backwards.

Link to comment
Share on other sites

Yes, it's important to understand that modder is a subset of programmer, as in, programming is a general activity bounded only by the project at hand, but modding is supremely-restrictive and bounded by the creativity and skill (or lack thereof) from an existing and separate programming team. You march to their drummer instead of your own. Being a modder really isn't for everyone, and the respect that people like Eloraam, Alblaka, and yes, even Sengir, deserve, despite their attitudes and methodologies, is great. Compared to them, the amount of actual modding I have to do for my little thing is a drop in the bucket, and just look how much work -that- is for me.

Link to comment
Share on other sites

The way most good modders learn things is to figure out how Minecraft itself does it and then just do it the same way. After you do that a few times, you start to figure out how to change it to suit your ideas.

so true, iv actually figured out alot of things by just looking at the code and yes Jeb has fucked alot of the code around but its all about messing around and trying different things, you should get it soon thx for the advice to man :D

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...