I had to end up using McModeler with the texture offsets from Techne though, as the belly/backfat and the boils on my model would never be in the correct place (when using techne only), but when I redid my model in McModeler and put the generated code from it into my ModelMyMob file, (while also changing setpostition to set rotation point), everything got put into the correct spot this time. I also noticed, that mcp hates custom mob skins and custom sounds, so if you have modloader installed and audiomod installed when making a mob that goes along with mobloader, you may have to test out your mob on the actual game to see if it works or not. I had to put my mob files into the actual minecraft jar file, and everything was working fine, except my mob has a large than needed hit box that keeps it from being able to touch me sometimes.
The hit box size is set in the entity class for the mob : setSize(x,y);
I got that it's the yaw, but once I get the yaw (angle in radians as they give it), how do I convert that to a block 10 steps away? I used to be good at math... :sad.gif:
I need help getting the last part to work. The model previous I showed wasn't using ModLoader (used the Techne part of the tutorial) so now I attempted to use ModLoader and I get 4 errors:
Hmmm I am usure on what size to make the hitbox though, as the only ones I seem to have found example wise in the jar file are animal based. The mob itself is about the size of a zombie, but slightly wider.
Hmmm I am usure on what size to make the hitbox though, as the only ones I seem to have found example wise in the jar file are animal based. The mob itself is about the size of a zombie, but slightly wider.
maybe try the pig or cow size. I was trying to see what it does (hope it would scale larger at the time), and noticed that I could get close to the mob. I can't tell you what range the values have. Have to go trial and error.
I need help getting the last part to work. The model previous I showed wasn't using ModLoader (used the Techne part of the tutorial) so now I attempted to use ModLoader and I get 4 errors...
are you using Eclipse? I find it invaluable, as it point errors out as you are coding. Now I am no java wiz, I've modded before with other games in other languages, and I seem to get that kind of flow. But as to the errors, it would seem that there may be class issues. It doesn't seem to like your calls to the parent class. You may have to ask elsewhere for those issues. Sorry...
Updated some of my java code vars and methods. You can now have a name appear over you new mob (see Render Java)
Nice creature! Looks like a combo between a lion and a flying monkey.
Anyway, I've gotten only one problem now: Everything compiles fine, no errors, but the mod is not run ingame. I added 2 recipes but both do not work; and my NPCs do not appear. This is on a newly generated world too. What did I do wrong? Can't I just recompile and hit start_client.bat after adding my edited files to the src folder?
Finally got everything to compile and show up! I had used "Mod_" as a prefix, not "mod_". The only problem I've been having is making it use the right textures; for an item it doesn't respond to me giving it new coordinates (or in block's case a higher number) and shows the same thing every time. I wanted to keep the same format MC uses (that being having them all in one big png instead of alot of little pngs) so is there a way around this?
You could save the java file, and go into Techne and Import it. Then edit the small bugs, and re-export it. You would still have done it by hand, but just fixed some bugs faster.
I would go with what Lancer is saying. I hope you also looked at other model files that use the ModelBase class directly. You may be missing something.
Nice creature! Looks like a combo between a lion and a flying monkey.
Anyway, I've gotten only one problem now: Everything compiles fine, no errors, but the mod is not run ingame. I added 2 recipes but both do not work; and my NPCs do not appear. This is on a newly generated world too. What did I do wrong? Can't I just recompile and hit start_client.bat after adding my edited files to the src folder?
Finally got everything to compile and show up! I had used "Mod_" as a prefix, not "mod_". The only problem I've been having is making it use the right textures; for an item it doesn't respond to me giving it new coordinates (or in block's case a higher number) and shows the same thing every time. I wanted to keep the same format MC uses (that being having them all in one big png instead of alot of little pngs) so is there a way around this?
No dice on that for now. ModLoader is stuck at one png per object, which will lead to png over load if you add to many items, or start combining mods. The reason they all look the same is that it only uses the first 16x16 block of the image.
No dice on that for now. ModLoader is stuck at one png per object, which will lead to png over load if you add to many items, or start combining mods. The reason they all look the same is that it only uses the first 16x16 block of the image.
I hope that it's changed to work like MC's because then png overload is incredibly unlikely to occur even with 5-6 major block mods because instead of 7-8 pngs each they'd all use 1 png each.
Although what you say is not entirely true, my images are alligned as such but ingame is shows the pink box with a purple line (BUT it's different (however slightly) when I change it; 2 is that, 3 has green-tipped edges and no purple line. No idea why.)
my items.png has the egg at 0,0 but ingame I only see one pixel of it :S
I know what you mean. Might have to cross the boat code with the pig. I haven't looked at that yet, just finishing up some GUI code. Eventually I hope to add that and more to this tutorial page.
@blueShinyApple:
If you are getting a texture error when trying out the mob in the little minecraft coder pack test world area, then the texture issue could just be because of the minecraft coder pack.... I had to test out my mob in the actual game itself for the textures to pop up.
@blueShinyApple:
If you are getting a texture error when trying out the mob in the little minecraft coder pack test world area, then the texture issue could just be because of the minecraft coder pack.... I had to test out my mob in the actual game itself for the textures to pop up.
On this, read my fist post. If you run the code from eclipse, you need to store it outside of the jar file.
On another note, the GUI for my spawn block is now posted. Here's how it looks in action:
The hit box size is set in the entity class for the mob : setSize(x,y);
OLD 1.7: http://www.minecraftforum.net/topic/529327-modloader173-adding-custom-mobs-and-more/ ---inLanoche says : USE ECLIPSE
I got that it's the yaw, but once I get the yaw (angle in radians as they give it), how do I convert that to a block 10 steps away? I used to be good at math... :sad.gif:
OLD 1.7: http://www.minecraftforum.net/topic/529327-modloader173-adding-custom-mobs-and-more/ ---inLanoche says : USE ECLIPSE
I updated my post with the full code. Hope this helps.
OLD 1.7: http://www.minecraftforum.net/topic/529327-modloader173-adding-custom-mobs-and-more/ ---inLanoche says : USE ECLIPSE
ERROR LOG
2011-08-08 17:07 - commands.recompile - ERROR - "C:\Program Files (x86)\Java\jdk1.7.0\bin\javac.exe" -g -verbose -classpath "lib/;lib/*;jars/bin/minecraft.jar;jars/bin/jinput.jar;jars/bin/lwjgl.jar;jars/bin/lwjgl_util.jar" -sourcepath src/minecraft -d bin/minecraft src/minecraft\net\minecraft\client\*.java src/minecraft\net\minecraft\isom\*.java src/minecraft\net\minecraft\src\*.java conf/patches/*.java failed.
2011-08-08 17:07 - commands.recompile - ERROR - Return code : 1
2011-08-08 17:07 - commands.recompile - ERROR -
2011-08-08 17:07 - commands.recompile - ERROR - == ERRORS FOUND ==
2011-08-08 17:07 - commands.recompile - ERROR -
2011-08-08 17:07 - commands.recompile - ERROR - src\minecraft\net\minecraft\src\Mod_CreeperKeeper.java:44: error: cannot find symbol
2011-08-08 17:07 - commands.recompile - ERROR - public void AddRenderer(Map map)
2011-08-08 17:07 - commands.recompile - ERROR - ^
2011-08-08 17:07 - commands.recompile - ERROR -
2011-08-08 17:07 - commands.recompile - ERROR - symbol: class Map
2011-08-08 17:07 - commands.recompile - ERROR - location: class Mod_CreeperKeeper
2011-08-08 17:07 - commands.recompile - ERROR - src\minecraft\net\minecraft\src\Mod_CreeperKeeper.java:74: error: cannot find symbol
2011-08-08 17:07 - commands.recompile - ERROR - Map map;
2011-08-08 17:07 - commands.recompile - ERROR - ^
2011-08-08 17:07 - commands.recompile - ERROR -
2011-08-08 17:07 - commands.recompile - ERROR - symbol: class Map
2011-08-08 17:07 - commands.recompile - ERROR - location: class Mod_CreeperKeeper
2011-08-08 17:07 - commands.recompile - ERROR - src\minecraft\net\minecraft\src\Mod_CreeperKeeper.java:46: error: no suitable constructor found for ModelCalmCreeper(ModelCalmCreeper,float)
2011-08-08 17:07 - commands.recompile - ERROR - map.put(EntityCalmCreeper.class, new ModelCalmCreeper(new ModelCalmCreeper(), 0.5F));
2011-08-08 17:07 - commands.recompile - ERROR - ^
2011-08-08 17:07 - commands.recompile - ERROR -
2011-08-08 17:07 - commands.recompile - ERROR - constructor ModelCalmCreeper.ModelCalmCreeper(float) is not applicable
2011-08-08 17:07 - commands.recompile - ERROR - (actual and formal argument lists differ in length)
2011-08-08 17:07 - commands.recompile - ERROR - constructor ModelCalmCreeper.ModelCalmCreeper() is not applicable
2011-08-08 17:07 - commands.recompile - ERROR - (actual and formal argument lists differ in length)
2011-08-08 17:07 - commands.recompile - ERROR - src\minecraft\net\minecraft\src\Mod_CreeperKeeper.java:47: error: constructor ModelBabyCreeper in class ModelBabyCreeper cannot be applied to given types;
2011-08-08 17:07 - commands.recompile - ERROR - map.put(EntityBabyCreeper.class, new ModelBabyCreeper(new ModelBabyCreeper(), 0.5F));
2011-08-08 17:07 - commands.recompile - ERROR - ^
2011-08-08 17:07 - commands.recompile - ERROR -
2011-08-08 17:07 - commands.recompile - ERROR - required: no arguments
2011-08-08 17:07 - commands.recompile - ERROR - found: ModelBabyCreeper,float
2011-08-08 17:07 - commands.recompile - ERROR - reason: actual and formal argument lists differ in length
2011-08-08 17:07 - commands.recompile - ERROR - 4 errors
2011-08-08 17:07 - commands.recompile - ERROR - ==================
2011-08-08 17:07 - commands.recompile - ERROR -
2011-08-08 17:07 - commands.checksources - WARNING - !! Can not find server sources !!
MY MOD CODE
import java.util.Random;
public class Mod_CreeperKeeper extends BaseMod
{
public Mod_CreeperKeeper()
{
world = ModLoader.getMinecraftInstance().theWorld;
ModLoader.RegisterBlock( groxian );
ModLoader.RegisterBlock( creepion );
ModLoader.AddName( groxian, "Groxian" );
ModLoader.AddName( creepion, "Creepion" );
ModLoader.AddName( creepEgg, "Creeper Egg" );
groxian.blockIndexInTexture = ModLoader.addOverride( "/terrain.png", "/groxkiller/terrain.png" );
creepion.blockIndexInTexture = ModLoader.addOverride( "/terrain.png", "/groxkiller/terrain.png" );
creepEgg.iconIndex = ModLoader.addOverride("/gui/items.png", "/groxkiller/items.png");
//-----NPCS-----//
ModLoader.RegisterEntityID(EntityCalmCreeper.class, "calmCreeper", ModLoader.getUniqueEntityId());
ModLoader.RegisterEntityID(EntityBabyCreeper.class, "babyCreeper", ModLoader.getUniqueEntityId());
ModLoader.AddSpawn(EntityCalmCreeper.class, 100, EnumCreatureType.creature);
ModLoader.AddSpawn(EntityBabyCreeper.class, 100, EnumCreatureType.creature);
//-----RECIPES-----//
ModLoader.AddRecipe(new ItemStack(groxian, 2), new Object[] {
"a", "b", Character.valueOf('a'), Block.dirt , Character.valueOf('b'), Block.sand
});
ModLoader.AddRecipe(new ItemStack(creepion, 4), new Object[] {
"a", Character.valueOf('a'), Block.dirt
});
}
public void AddRenderer(Map map)
{
map.put(EntityCalmCreeper.class, new ModelCalmCreeper(new ModelCalmCreeper(), 0.5F));
map.put(EntityBabyCreeper.class, new ModelBabyCreeper(new ModelBabyCreeper(), 0.5F));
}
public String Version()
{
return "1.0";
}
//-----BLOCKS-----//
public static final Block groxian;
public static final Block creepion;
//-----ITEMS-----//
public static Item creepEgg;
//----Initialize Ents----//
static
{
groxian = (new BlockGroxian(200, 0)).setHardness(0.5F).setResistance(5F).setStepSound(Block.soundStoneFootstep).setBlockName("groxian").setLightValue(1.0F);
creepion = (new BlockCreepion(201, 1)).setHardness(0.5F).setResistance(5F).setStepSound(Block.soundStoneFootstep).setBlockName("creepion");
creepEgg = (new ItemCreepEgg(500)).setIconCoord(0, 0).setItemName("creepEgg");
}
//-----MISC-----//
World world;
Map map;
}
maybe try the pig or cow size. I was trying to see what it does (hope it would scale larger at the time), and noticed that I could get close to the mob. I can't tell you what range the values have. Have to go trial and error.
OLD 1.7: http://www.minecraftforum.net/topic/529327-modloader173-adding-custom-mobs-and-more/ ---inLanoche says : USE ECLIPSE
are you using Eclipse? I find it invaluable, as it point errors out as you are coding. Now I am no java wiz, I've modded before with other games in other languages, and I seem to get that kind of flow. But as to the errors, it would seem that there may be class issues. It doesn't seem to like your calls to the parent class. You may have to ask elsewhere for those issues. Sorry...
OLD 1.7: http://www.minecraftforum.net/topic/529327-modloader173-adding-custom-mobs-and-more/ ---inLanoche says : USE ECLIPSE
OLD 1.7: http://www.minecraftforum.net/topic/529327-modloader173-adding-custom-mobs-and-more/ ---inLanoche says : USE ECLIPSE
Nice creature! Looks like a combo between a lion and a flying monkey.
Anyway, I've gotten only one problem now: Everything compiles fine, no errors, but the mod is not run ingame. I added 2 recipes but both do not work; and my NPCs do not appear. This is on a newly generated world too. What did I do wrong? Can't I just recompile and hit start_client.bat after adding my edited files to the src folder?Finally got everything to compile and show up! I had used "Mod_" as a prefix, not "mod_". The only problem I've been having is making it use the right textures; for an item it doesn't respond to me giving it new coordinates (or in block's case a higher number) and shows the same thing every time. I wanted to keep the same format MC uses (that being having them all in one big png instead of alot of little pngs) so is there a way around this?
I would go with what Lancer is saying. I hope you also looked at other model files that use the ModelBase class directly. You may be missing something.
OLD 1.7: http://www.minecraftforum.net/topic/529327-modloader173-adding-custom-mobs-and-more/ ---inLanoche says : USE ECLIPSE
No dice on that for now. ModLoader is stuck at one png per object, which will lead to png over load if you add to many items, or start combining mods. The reason they all look the same is that it only uses the first 16x16 block of the image.
OLD 1.7: http://www.minecraftforum.net/topic/529327-modloader173-adding-custom-mobs-and-more/ ---inLanoche says : USE ECLIPSE
I hope that it's changed to work like MC's because then png overload is incredibly unlikely to occur even with 5-6 major block mods because instead of 7-8 pngs each they'd all use 1 png each.
Although what you say is not entirely true, my images are alligned as such but ingame is shows the pink box with a purple line (BUT it's different (however slightly) when I change it; 2 is that, 3 has green-tipped edges and no purple line. No idea why.)
my items.png has the egg at 0,0 but ingame I only see one pixel of it :S
Well up to the controllable part you can just copy the pig's code for being rideable.
Yeah but I need to make it controllable soo.
I know what you mean. Might have to cross the boat code with the pig. I haven't looked at that yet, just finishing up some GUI code. Eventually I hope to add that and more to this tutorial page.
OLD 1.7: http://www.minecraftforum.net/topic/529327-modloader173-adding-custom-mobs-and-more/ ---inLanoche says : USE ECLIPSE
If you are getting a texture error when trying out the mob in the little minecraft coder pack test world area, then the texture issue could just be because of the minecraft coder pack.... I had to test out my mob in the actual game itself for the textures to pop up.
On this, read my fist post. If you run the code from eclipse, you need to store it outside of the jar file.
On another note, the GUI for my spawn block is now posted. Here's how it looks in action:
OLD 1.7: http://www.minecraftforum.net/topic/529327-modloader173-adding-custom-mobs-and-more/ ---inLanoche says : USE ECLIPSE
Nice, good for doing a quick check on any mobs you may make. Guess I should make one too, as currently I just wait till nightfall....