You'd have to check what angle it wants to look at. This you would have to probably mess with quite a bit of code, probably from EntityLiving.java. What would do (similar to my car entity) is strip out the actionstates. Then make your own. You would have to code the AI for looking and walking in general. When it needs to change where it is facing, check to see if the desired angle would say be between (and look at my YAW code in my GUI to keep the number between 0 and 360 for ease of use) 225 and 45, and set the facing to 0. Do this for all 90 degree view arcs (or as specific as you want it), and set the rotationYaw to 0, 90, 180 or 270. I would leave the pitch at 0
amazing great, info . Ill try it
ah and PlayerAPI allows us to overwrite some functions inside EntityPlayer, without the need to change the main class. - Info that I obtained a week ago
ah and PlayerAPI allows us to overwrite some functions inside EntityPlayer, without the need to change the main class. - Info that I obtained a week ago
How exactly can you code that? Don't you need to set hooks (like ModLoader) to be able to access what is there externally without making changes?
Well if you know how to do that, I'll work with you on the other stuff, though leveling seems to be included in release 1.8. Might be a good learning project still, there are other areas I would like to access without messing with the base code.
I have my mob working now but a problem: my mob is almost alwys walking diagonally. (i can post pics if wanted)
his head turns toward me and the body is moving in the heads direction and not turning by itself and then walking straight forward.
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 im making a ufo mod but need to know how to make it fly and idk if this is the same HELP
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:
ok im making a ufo mod but need help on making is spawn and fly does this work for tht
Right at this moment im asking mr. Flan the creator of the PlayerAPI, if I can use his API, and also ask if he can give an insight on how to use it.
Once he agrees let us work on it. - Edit (He replied and yes it uses hooks)
Edit. I think he allows modders to use his API, also in his site he gave an example on how to use it, as a downloable source file in java :smile.gif: sweet!!!!!,
Oh and also, awhile ago i was trying to use turbomodelthingy to create a spherical model in techne,
But in all my tries, i could not get techne to export a texture map for it, have you tried doing spheres?
To make a player API mod simply make a class that extends PlayerBase (much like extending BaseMod) and register it with PlayerAPI.RegisterPlayerBase(PlayerBaseExample.class); in your mod_ file constructor. An example PlayerBaseMoods is included in the download
To get a PlayerBase from the player you can use the method PlayerAPI.getPlayerBase(player, PlayerBaseExample.class);
If you require more hooks to make your mod work with player API, please PM me and it should be in the next release
Well that was easier then expected, well if you don't feel like using a spawn block to spawn your mob you could always use an item like so :
public class ItemSpawnStaff extends Item
{
public ItemSpawnStaff(int i)
{
super(i);
maxStackSize = 1;
setMaxDamage(64);
}
public boolean onItemUse(ItemStack itemstack, EntityPlayer entityplayer, World world, int i, int j, int k, int l)
{
if(!world.multiplayerWorld)
{
EntityLiving entityliving = (EntityLiving)EntityList.createEntityInWorld("MyMob", entityplayer.worldObj);
entityliving.setLocationAndAngles(i, j + 1, k, 0F, 0F);
entityplayer.worldObj.entityJoinedWorld(entityliving);
}
return true;
}
}
Use the same code for spawn block but in item form.
tis true, but it came down to what was easier to make, an item or a block. Most of the tutorials started with making a block so, I went with that as the simpler form.
Just wanted to let you all know that I am trying out ModLoader, AudioMod, and SignTags 1.8.1 with the current version of MCP. If it goes in with no errors, I will continue from the point with 1.8.1. If you are interested in following (wait till I signal the OK, and do a proper backup of your MCP files) here is the link to the modloader stuff:
I did put it in the minecraft.jar file, in fact, i used the startclient.bat previously. Now, i reobf and drag them into my minecraft.jar folder and checked that everything was there.
Result:
As you can see, the monster is obviously not spawning(might take a while to load) :sad.gif:
Still no texture :sad.gif:
If someone knows how to solve this, will be rewarded with 10 truckloads of
I did put it in the minecraft.jar file, in fact, i used the startclient.bat previously. Now, i reobf and drag them into my minecraft.jar folder and checked that everything was there.
Result:
As you can see, the monster is obviously not spawning(might take a while to load) :sad.gif:
Still no texture :sad.gif:
If someone knows how to solve this, will be rewarded with 10 truckloads of
I actually had the same problem as this guy. All my mobs had their textures in the startclient.bat, and when I put them into the actual minecraft. Once I animated them, the Hyena and Gorilla both lost their texture and are now white. I've been to busy to mess around with it. I know I named the texture right, and named it right in the .java, I put it in the right folder and everything. Did it the same way I did every other mob, but it's only those 2 that are messed up.
I did put it in the minecraft.jar file, in fact, i used the startclient.bat previously. Now, i reobf and drag them into my minecraft.jar folder and checked that everything was there.
Result:
As you can see, the monster is obviously not spawning(might take a while to load) :sad.gif:
Still no texture :sad.gif:
If someone knows how to solve this, will be rewarded with 10 truckloads of
Edit: Created a new world, and world is filled with that mobs=lag city
But i still cannot fix the other problem someone please help!
//fields
public ModelRendererTurbo horn_2;
public ModelRenderer head;
public ModelRenderer body;
public ModelRenderer rightarm;
public ModelRenderer leftarm;
public ModelRenderer rightleg;
public ModelRenderer leftleg;
public ModelRenderer I_NEED_A_NAME;
public ModelRendererTurbo horn_1;
public ModelRendererTurbo tail_1;
public ModelRendererTurbo tail_2;
public ModelRendererTurbo tail_sharp;
}
package net.minecraft.src
import java.utill.map;
import net.minecraft.client.Minecraft;
public class mod_devil extends BaseMod
(
public mod_devil();
(
Modloader.RegisterEntityID(net.minecraft.src.Entitydevil.class, "Devil",Modloader.getUniqueEntityid());
Modloader.AddSpawn(net.minecraft.src.Entitydevil.class, "16", EnumCreatureType.monster);
)
public String Version()
(
return "devil v.10 mc v1.8"
)
public void AddRenderer(Map map)
(
map.put(net.minecraft.src.Entitydevil.class, new Renderdevil(new ModelDevil(), 0,5f));
)
Thanks. Too many questions poping up here based syntax. I get PMs on them all the time... People don't seem to understand how much time eclipse will save.... Especially since I'm not touching any more compile errors...
I need to make a more Eclipse expressive banner... If there wasn't a movie tied to the name, I would use it for my mod name...
Ok, my attempts to do anything without MCP fully compatable with 1.8.1 are now worn out... I'm not sure I'm going to do any more tuts on 1.7.3 (or any for that matter) until 1.8.1. At that point I will continue to (and most likely udate) more tutorials as I go on. They may start to wind down as I may kick my own mod idea into works.
amazing great, info . Ill try it
ah and PlayerAPI allows us to overwrite some functions inside EntityPlayer, without the need to change the main class. - Info that I obtained a week ago
link: The Dragon Ball Mod Alpha 1.1
How exactly can you code that? Don't you need to set hooks (like ModLoader) to be able to access what is there externally without making changes?
Well if you know how to do that, I'll work with you on the other stuff, though leveling seems to be included in release 1.8. Might be a good learning project still, there are other areas I would like to access without messing with the base code.
OLD 1.7: http://www.minecraftforum.net/topic/529327-modloader173-adding-custom-mobs-and-more/ ---inLanoche says : USE ECLIPSE
How is it's movement being handled?
OLD 1.7: http://www.minecraftforum.net/topic/529327-modloader173-adding-custom-mobs-and-more/ ---inLanoche says : USE ECLIPSE
Right at this moment im asking mr. Flan the creator of the PlayerAPI, if I can use his API, and also ask if he can give an insight on how to use it.
Once he agrees let us work on it. - Edit (He replied and yes it uses hooks)
Edit. I think he allows modders to use his API, also in his site he gave an example on how to use it, as a downloable source file in java :smile.gif: sweet!!!!!,
here is the link to his site only: WW2 Planes by JamioFlan
Go the the download where playerAPI is
"Thanks Mr. JamioFlan for This, respect!!!"
"If anyone knows how to use API, please share"
Oh and also, awhile ago i was trying to use turbomodelthingy to create a spherical model in techne,
But in all my tries, i could not get techne to export a texture map for it, have you tried doing spheres?
link: The Dragon Ball Mod Alpha 1.1
- mr jamioflan
link: The Dragon Ball Mod Alpha 1.1
tis true, but it came down to what was easier to make, an item or a block. Most of the tutorials started with making a block so, I went with that as the simpler form.
OLD 1.7: http://www.minecraftforum.net/topic/529327-modloader173-adding-custom-mobs-and-more/ ---inLanoche says : USE ECLIPSE
Just wanted to let you all know that I am trying out ModLoader, AudioMod, and SignTags 1.8.1 with the current version of MCP. If it goes in with no errors, I will continue from the point with 1.8.1. If you are interested in following (wait till I signal the OK, and do a proper backup of your MCP files) here is the link to the modloader stuff:
http://www.minecraftforum.net/topic/75440-v181-risugamis-mods-everything-updated/
If this fails out, or there is too much to fix, I will drop back down to 1.7.3 until MCP is up to speed.
OLD 1.7: http://www.minecraftforum.net/topic/529327-modloader173-adding-custom-mobs-and-more/ ---inLanoche says : USE ECLIPSE
My EntityTest:
And the one for the model:
There is a picture in \mob\test. Please help! Reward will be a full of
Thanks!
2.texture is named test but saved as png
3.yes
Please help
Did you put the same picture in the mob folder in the minecraft.jar file? That's most likely your issue.
OLD 1.7: http://www.minecraftforum.net/topic/529327-modloader173-adding-custom-mobs-and-more/ ---inLanoche says : USE ECLIPSE
Result:
As you can see, the monster is obviously not spawning(might take a while to load) :sad.gif:
Still no texture :sad.gif:
If someone knows how to solve this, will be rewarded with 10 truckloads of
I actually had the same problem as this guy. All my mobs had their textures in the startclient.bat, and when I put them into the actual minecraft. Once I animated them, the Hyena and Gorilla both lost their texture and are now white. I've been to busy to mess around with it. I know I named the texture right, and named it right in the .java, I put it in the right folder and everything. Did it the same way I did every other mob, but it's only those 2 that are messed up.
Edit: Created a new world, and world is filled with that mobs=lag city
But i still cannot fix the other problem someone please help!
You forgot a ";" on line 9 in mod_vampire.
Use Eclipse.
if any error help me
Use Eclipse, that will tell you if there are errors or not.
Which there are a few.
Thanks. Too many questions poping up here based syntax. I get PMs on them all the time... People don't seem to understand how much time eclipse will save.... Especially since I'm not touching any more compile errors...
I need to make a more Eclipse expressive banner... If there wasn't a movie tied to the name, I would use it for my mod name...
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