You need to post what the errors are. But just of the hat, in your Model file, you do not define hand1 and hand2. Look at my anibus code. at the bottom (after //fields) I define the new parts, as they are not define by the base ModelQuadruped class.
I changed the hand1 and hand2 leg3 and leg4 and still not working.
Here's the code:
EntityPerius:
You still have yet to post what the error is. But looking at body.addBox(-5F, -5F, -7F, 8, 7.2666666666666, 14, 0F);
, the 7.2666666 should be an int (7 or 8). Please post the error if you need more help.
I'm a jerk. Ment to post the code on how I made the flying thing. Now this isn't how to make you fly, but you can probably work that out from what I show you. This is for flying creatures like the chicken.
I'll do the easy part first, adding some stuff for the animations. Just like with the legs and arms, on flight movement there is a float value passed to setRotationAngles, which is passed as f2. So if you wnat it to flap wings (or if you are creative, a cape flapping, maybe a propellar spinning) set your wing parts like so:
Ok, now on to the flying part. Now I didn't play with this, as I was again making something like the chicken. later I may add some code to have it start to fly and maybe stay flying for a while. For now this was enough to show how it can be done. What we need is the onLivingUpdate() method from the chicken entity file. I will tell you that I am not versed enough in Java to understand some of the code (such as the line destPos += (double)(onGround ? -1 : 4) * 0.29999999999999999D; (though I think it's a mulitplier with a bolean test of on ground, yes being -1, no being 4). I do know that motionY is what we want to work with. here's the code I stole:
public void onLivingUpdate()
{
super.onLivingUpdate();
field_756_e = field_752_b;
field_757_d = destPos;
destPos += (double)(onGround ? -1 : 4) * 0.29999999999999999D;
if(destPos < 0.0F)
{
destPos = 0.0F;
}
if(destPos > 1.0F)
{
destPos = 1.0F;
}
if(!onGround && field_755_h < 1.0F)
{
field_755_h = 1.0F;
}
field_755_h *= 0.90000000000000002D;
if(!onGround && motionY < 0.0D)
{
motionY *= 0.59999999999999998D;
}
field_752_b += field_755_h * 2.0F;
if(this.isInWater())
{
posY += 1;
this.motionY += 0.5;
}
/* --subbed out from chicken code, but can have a timer to do something, like jump up and fly
if(!worldObj.multiplayerWorld && --timeUntilNextEgg <= 0)
{
worldObj.playSoundAtEntity(this, "mob.chickenplop", 1.0F, (rand.nextFloat() - rand.nextFloat()) * 0.2F + 1.0F);
dropItem(Item.egg.shiftedIndex, 1);
timeUntilNextEgg = rand.nextInt(6000) + 6000;
}
*/
}
That's pretty much it. Well, you say, how do I see it fly? well let's make a little code to "poke" it into flying. Add this other method:
public boolean interact(EntityPlayer entityplayer)
{
//rightclick on this entity to make it jump up
this.motionY += 1;
return true;
}
Don't use a big number, this will have it jump several feet into the air, then flap it's wings back down. If you notice, they use multipliers (of less than 1) when adjusting the motionY variable. I once set it to 5, and wondered where the mob went. It was way up in the sky, and took a while to get back down.
If you want to make a block that throws you into the air, you can use this idea on a block. Of course, if you don't have the flying code, you're in for quite a fall. :smile.gif:
@narutoall76:
I do believe that may be some error having to do maybe putting the wrong blockId. Do you have a mod_*** file, where your new block is added to the game?
it needs to be called mod_(block name)???if so,ill try.
I think it might be more that you forgot to do all the initialization for the block. The same happened to me when I made my first spawn block. Go back and make sure you added all the proper parts for your new block in your main mod_ java file.
The block names can be what ever format you want. You don't even need the work block in them. Just be consistant or you may lose track of what you are doing.
Ok, I don't mean to be rude, but these tutorials are not for beginners. I am taking it for granted that you have gone over the more basic tutorials. If I have to keep coming back to go over the basics, I won't get any new stuff done.
There are plenty of tutorials here to get modloader setup, get the MCP going, and getting started. Please go through these first. I will help with areas that I have gone over here. Please read the OP.
The method addBox(float, float, float, int, int, int, float) in the type ModelRenderer is not applicable for the arguments (float, float, float, int, double, double, float)
yet it dosent do that for the other addboxes.
and then addmobs hasthe most,this could be where the errors are coming from,i get like
20 errors.ill show some.
-Syntax error on token "void", @ expected
-Syntax error on token ";", , expected
-Syntax error, insert "EnumBody" to complete TypeDeclarations
-Syntax error on token "void", @ expected
-Syntax error on token(s), misplaced construct(s)
-Syntax error on token ")", = expected
-Syntax error, insert "EnumBody" to complete EnumDeclaration
here are the files(ill underline things that it marks are wrong)
JWorldAddMod
//fields
public ModelRenderer head;
public ModelRenderer body;
public ModelRenderer leg1;
public ModelRenderer leg2;
public ModelRenderer leg3;
public ModelRenderer leg4;
}
Since the requirments are ints you can't have doubles (decimals)
ok,this is the last problem i have.
when i create the code in Block.java,AKA this
GlowingGold = (new BlockGlowingGold(103, ModLoader.addOverride("/terrain.png", "/mods/JSpawnBlock.png" ))).setHardness(0.7F).setStepSound(Block.soundSandFootstep).setBlockName("GlowingGold");
,i get this:
The constructor BlockGlowingGold(int, int) is undefined
weird...
Did you create a BlockGlowingGold.java file? If you did then you did not make a constructor for it, or it is made incorrectly. If you are having trouble with your block code. Ask in the block tutorial forums please.
They are tamable... 497 lines of text in the Entity :tongue.gif:
I also got the name working... May implement a random name generator by A guy I was talking to!
Ok, was working on some HUD stuff for the passed day. So I got an overly on the screen (HUD) that has a stat bar that will drain over time. Intervals will be worked out later, my issue was/has been trying to keep it contant with the player. Well, I have found out that the variable worldObj.getWorldTime() is not the time of day, but how long the world has existed. This is good, becaue the time values associated with the playe entity are reset everytime a game is loaded. I just need a way to save the value of my stat to the player, or to the game (which would exclude it's use from multiplayer). Anyone got any ideas on that? Also, does anyone know how the clock object/item is defined? I didn't see it with other item java files...
They are tamable... 497 lines of text in the Entity :tongue.gif:
I also got the name working... May implement a random name generator by A guy I was talking to!
Nice. What you can also do, if you want to be creative, is to make clan skins for them. So if his name has Mount in, then his texture would have brown, Water would have Blue, etc. Not that hard to implement, but having them group together might be more work. Glad to see this stuff is getting some practical use. (I'm talking about the beer gut!)
Looking at the errors, it seems to tell you what is wrong. I see quite a few missing ";"s there. Also, the first error seems to indicate a missing "}" to close out your code.
Are you using eclipse to edit the files? if not, I would suggest doing so. It will point out these errors while you write the code. Also, you can run the code from Eclipse without having to compile and all that other jazz. There are many tutorials (video and text) on getting Eclipse up and working with MCP. It will save you alot of time in the long run.
I understand that bit but i don't know where i add the list of names.
Here is what I did to make that list (in my main entity java file):
protected String[] mobNames = {"Tom","Joe","Mark","Larry","Duke","Jake"};
Then in my constructor:
int aName = rand.nextInt(6);
myName = mobNames[aName]; //given a random name from the name list mobNames
I could have probably put rand.nextInt(mobNames.length);, which would stay away from a hard coded number. There. fixed my own code a bit to. But that's it.
Sorry, this is probably really annoying for you but i still don't understand it :huh.gif:
I have this:
Entity:
package net.minecraft.src;
import java.util.Random;
public class M_NyanEntity extends EntityAnimal
{
public M_NyanEntity(World world)
{
super(world);
texture = "/nyan1.png";
setSize(1F,1F);
moveSpeed = 0.75F;
health = 3;
int aName = rand.nextInt(6);
myName = mobNames[aName]; //given a random name from the name list mobNames
}
public void writeEntityToNBT(NBTTagCompound nbttagcompound)
{
super.writeEntityToNBT(nbttagcompound);
}
public void readEntityFromNBT(NBTTagCompound nbttagcompound)
{
super.readEntityFromNBT(nbttagcompound);
}
protected int getDropItemId()
{
return 0;
}
public boolean interact(EntityPlayer entityplayer)
{
return false;
}
protected String[] mobNames = {"Tom","Joe","Mark"};
}
You still have yet to post what the error is. But looking at body.addBox(-5F, -5F, -7F, 8, 7.2666666666666, 14, 0F);
, the 7.2666666 should be an int (7 or 8). Please post the error if you need more help.
OLD 1.7: http://www.minecraftforum.net/topic/529327-modloader173-adding-custom-mobs-and-more/ ---inLanoche says : USE ECLIPSE
I'm a jerk. Ment to post the code on how I made the flying thing. Now this isn't how to make you fly, but you can probably work that out from what I show you. This is for flying creatures like the chicken.
I'll do the easy part first, adding some stuff for the animations. Just like with the legs and arms, on flight movement there is a float value passed to setRotationAngles, which is passed as f2. So if you wnat it to flap wings (or if you are creative, a cape flapping, maybe a propellar spinning) set your wing parts like so:
Ok, now on to the flying part. Now I didn't play with this, as I was again making something like the chicken. later I may add some code to have it start to fly and maybe stay flying for a while. For now this was enough to show how it can be done. What we need is the onLivingUpdate() method from the chicken entity file. I will tell you that I am not versed enough in Java to understand some of the code (such as the line destPos += (double)(onGround ? -1 : 4) * 0.29999999999999999D; (though I think it's a mulitplier with a bolean test of on ground, yes being -1, no being 4). I do know that motionY is what we want to work with. here's the code I stole:
That's pretty much it. Well, you say, how do I see it fly? well let's make a little code to "poke" it into flying. Add this other method:
Don't use a big number, this will have it jump several feet into the air, then flap it's wings back down. If you notice, they use multipliers (of less than 1) when adjusting the motionY variable. I once set it to 5, and wondered where the mob went. It was way up in the sky, and took a while to get back down.
If you want to make a block that throws you into the air, you can use this idea on a block. Of course, if you don't have the flying code, you're in for quite a fall. :smile.gif:
OLD 1.7: http://www.minecraftforum.net/topic/529327-modloader173-adding-custom-mobs-and-more/ ---inLanoche says : USE ECLIPSE
I do believe that may be some error having to do maybe putting the wrong blockId. Do you have a mod_*** file, where your new block is added to the game?
I think it might be more that you forgot to do all the initialization for the block. The same happened to me when I made my first spawn block. Go back and make sure you added all the proper parts for your new block in your main mod_ java file.
The block names can be what ever format you want. You don't even need the work block in them. Just be consistant or you may lose track of what you are doing.
OLD 1.7: http://www.minecraftforum.net/topic/529327-modloader173-adding-custom-mobs-and-more/ ---inLanoche says : USE ECLIPSE
Nothing wrong with phineas and ferb across the second dimension. My daughter was watching it. :tongue.gif:
OLD 1.7: http://www.minecraftforum.net/topic/529327-modloader173-adding-custom-mobs-and-more/ ---inLanoche says : USE ECLIPSE
Ok, I don't mean to be rude, but these tutorials are not for beginners. I am taking it for granted that you have gone over the more basic tutorials. If I have to keep coming back to go over the basics, I won't get any new stuff done.
There are plenty of tutorials here to get modloader setup, get the MCP going, and getting started. Please go through these first. I will help with areas that I have gone over here. Please read the OP.
OLD 1.7: http://www.minecraftforum.net/topic/529327-modloader173-adding-custom-mobs-and-more/ ---inLanoche says : USE ECLIPSE
lol
What about point 1 :tongue.gif:
Since the requirments are ints you can't have doubles (decimals)
Did you create a BlockGlowingGold.java file? If you did then you did not make a constructor for it, or it is made incorrectly. If you are having trouble with your block code. Ask in the block tutorial forums please.
OLD 1.7: http://www.minecraftforum.net/topic/529327-modloader173-adding-custom-mobs-and-more/ ---inLanoche says : USE ECLIPSE
This is what your tutorials led to: http://www.minecraftforum.net/topic/543945-dwarf-model-now-i-have-the-dwarf-ingame/
They are tamable... 497 lines of text in the Entity :tongue.gif:
I also got the name working... May implement a random name generator by A guy I was talking to!
OLD 1.7: http://www.minecraftforum.net/topic/529327-modloader173-adding-custom-mobs-and-more/ ---inLanoche says : USE ECLIPSE
Nice. What you can also do, if you want to be creative, is to make clan skins for them. So if his name has Mount in, then his texture would have brown, Water would have Blue, etc. Not that hard to implement, but having them group together might be more work. Glad to see this stuff is getting some practical use. (I'm talking about the beer gut!)
OLD 1.7: http://www.minecraftforum.net/topic/529327-modloader173-adding-custom-mobs-and-more/ ---inLanoche says : USE ECLIPSE
It's here:
http://www.minecraftforum.net/topic/529327-modloader-adding-custom-mobs-and-more/page__view__findpost__p__7002615
it's the second method talked about.
OLD 1.7: http://www.minecraftforum.net/topic/529327-modloader173-adding-custom-mobs-and-more/ ---inLanoche says : USE ECLIPSE
Looking at the errors, it seems to tell you what is wrong. I see quite a few missing ";"s there. Also, the first error seems to indicate a missing "}" to close out your code.
Are you using eclipse to edit the files? if not, I would suggest doing so. It will point out these errors while you write the code. Also, you can run the code from Eclipse without having to compile and all that other jazz. There are many tutorials (video and text) on getting Eclipse up and working with MCP. It will save you alot of time in the long run.
OLD 1.7: http://www.minecraftforum.net/topic/529327-modloader173-adding-custom-mobs-and-more/ ---inLanoche says : USE ECLIPSE
Here is what I did to make that list (in my main entity java file):
protected String[] mobNames = {"Tom","Joe","Mark","Larry","Duke","Jake"};
Then in my constructor:
int aName = rand.nextInt(6);
myName = mobNames[aName]; //given a random name from the name list mobNames
I could have probably put rand.nextInt(mobNames.length);, which would stay away from a hard coded number. There. fixed my own code a bit to. But that's it.
OLD 1.7: http://www.minecraftforum.net/topic/529327-modloader173-adding-custom-mobs-and-more/ ---inLanoche says : USE ECLIPSE
you did not cast myName as a string. Post what the error is next time, makes it easier to find the issue.
OLD 1.7: http://www.minecraftforum.net/topic/529327-modloader173-adding-custom-mobs-and-more/ ---inLanoche says : USE ECLIPSE