Here you can find pre-made models like pig,cow,wolf etc.
PneumonicFungus did your spawner spawn pigs and such like i suggested?
I have borrowed your codes and tried to spawn your afropig in world and it actually worked.
(Although the model is kind of buggy and textureless because i don't have it)
I didn't alter any of your entity,render or model code however my mod code might be different and that might be the reason it works. I think i slowly remember that error and how i fixed it.I recreated the same error in my mod.
I recreated the same error you had by changing the "AfroPig" in spawner block code to something else. That way the spawner couldn't find the reference and crashed the game. There, try this out.
Thanks for this killNature, a good find.
And yes techne can be used for any model type in minecraft. You could easily make a vehicle mob.
The mob won't spawn naturally, and the spawn block crashes Minecraft when you left click.
Crash report:
Mods loaded: 2
ModLoader Beta 1.7.3
net.minecraft.src.mod_Champite 1.0 for MC Beta 1.7.3
Minecraft has crashed!
----------------------
Minecraft has stopped running because it encountered a problem.
If you wish to report this, please copy this entire text and email it to [email protected].
Please include a description of what you did when the error occured.
--- BEGIN ERROR REPORT 9b8f1121 --------
Generated 24/08/11 1:29 AM
Minecraft: Minecraft Beta 1.7.3
OS: Windows Vista (x86) version 6.0
Java: 1.6.0_26, Sun Microsystems Inc.
VM: Java HotSpot(TM) Client VM (mixed mode), Sun Microsystems Inc.
LWJGL: 2.4.2
OpenGL: GeForce 6150SE nForce 430/PCI/SSE2/3DNOW! version 2.1.2, NVIDIA Corporation
java.lang.NullPointerException
at net.minecraft.src.Champ_SpawnerBlock.onBlockClicked(Champ_SpawnerBlock.java:32)
at net.minecraft.src.PlayerControllerSP.clickBlock(PlayerControllerSP.java:63)
at net.minecraft.client.Minecraft.clickMouse(Minecraft.java:820)
at net.minecraft.client.Minecraft.runTick(Minecraft.java:1047)
at net.minecraft.client.Minecraft.run(Minecraft.java:480)
at java.lang.Thread.run(Unknown Source)
--- END ERROR REPORT 96ff40de ----------
Make sure that your string name for the afropig call in the spawn block is "EXACTLY" the same as it is defined in your main mod_ java file. Looking at the spawn call you have it as "afropig". If it has captials or is spaced or something in it's definition, this code won't find it.
I have to say I love the way you explain the small bits of code and what they do. Too many tutorials just give a long code, "This code does this." Without an explanation of the individual smaller bits.
Rollback Post to RevisionRollBack
If you think something's impossible.
You haven't tried hard enough.
Guys, if you would please take the time to go back to the first page and press that little green button on the first post in the bottom right corner, it would really help Inlanoche and it would show your support for his tutorials :smile.gif:
Rollback Post to RevisionRollBack
Famous Nyan seed has caves now along with 3 other special maps for MCPE! Check here for downloads: http://tinyurl.com/c75ax6y
I've been trying to find this, but haven't figured it out. I know how to add achievements, but, i haven't found a way to add an achievement for when the mob is killed by the player. (For example when a player kills a cow he gets the achievement.) Anyone here happen to know how, or if its even possible?
Maybe set a variable like cowDead and set it to false. Then, if the cow is dead you set cowDead to true and if cowDead is true you do the achievement. I don't know if this will work but it might be worth a try.
Edit: there is already an achievement for killing a monster. You could probably borrow that code and make it work.
I've been trying to find this, but haven't figured it out. I know how to add achievements, but, i haven't found a way to add an achievement for when the mob is killed by the player. (For example when a player kills a cow he gets the achievement.) Anyone here happen to know how, or if its even possible?
I'm sure it's possible. You would have to run a check when it's killed. The (checking the entity that killed it, call the achievement:
entityplayer.addStat(KilledCow, 1);
(KilledCow would be the name of the achievement)
Just found it. Put it in here:
public void onEntityDeath()
{
}
the problem is checking for what killed it. Will have to look around for that. This would be an issue though for built in mobs, as you would have to change the code in it's entity file.
Does any one have any idea how to get a mob to drop an item when the player interacts with it i.e. I give the mob a bone and it gives me back a gold bar. I know how to get the mob to say something when I give it a bone but not drop an item. I have been looking at the item drop methods in EnyityPlayer and the dispense item method in BlockDispenser to get an idea on what I need to add to my code. I think I will most likely use the code in EntityPlayer, but I don't know where to go from there. So any help will be greatly appreciated.
I've never spawned an item. Are you trying to put it right in the player's inventory? If so, you would first have to check for an empty slot. You check should include fail code (if no slots are free). I have not yet "spawned" items, so I'm not totally sure how that would work, maybe look at the code for when you break blocks. Just on my way out now, but thought I'd give a start for you.
I tried like this. It didn't give any errors or such. However in game no matter what i set the instance it doesn't give me the achievement. I tried it on pigs,cows and my own mobs too.
Say I made a jockey mob, and I wanted him to jump on to the player or say other mobs and just sort of ride on them and control their movement, how would I get the jockey to sit in the right spot? So far he always seems to just sit about two or a block and a half above the players head....
Not really spawn the item into the player's inventory more of just drop the item like the player does when they hit Q although I guess you would have to create an inventory for the mob. But I'll have to see which one takes less code to do.
You don't need inventory in the mob. You just need to find the code to spawn an object at x,y,z. You'll have x,y,z from the entity droping the object, you just need to spawn the object at that point. I'll take a look at this in a bit.
I tried like this. It didn't give any errors or such. However in game no matter what i set the instance it doesn't give me the achievement. I tried it on pigs,cows and my own mobs too.
good idea, wrong method though. I like to look back to when these methods are called. If you look in entityliving, you see that that method is called in onDeath(). Also looking in the onDeath method, you can see that this is where a score is assigned, and would most likely be assigned to the killer. We don't need to really change that, but let's add to it:
public void onDeath(Entity entity)
{
super.onDeath(entity); //run the orginal onDeath method
if(entity instanceof EntityPlayer) //did a player kill this?
{
entity.addStat(achievement1, 1); //Achievement... Achieved!
}
}
good idea, wrong method though. I like to look back to when these methods are called. If you look in entityliving, you see that that method is called in onDeath(). Also looking in the onDeath method, you can see that this is where a score is assigned, and would most likely be assigned to the killer. We don't need to really change that, but let's add to it:
public void onDeath(Entity entity)
{
super.onDeath(entity); //run the orginal onDeath method
if(entity instanceof EntityPlayer) //did a player kill this?
{
entity.addStat(achievement1, 1); //Achievement... Achieved!
}
}
Is this supposed to go to the Entity, or the mod file? I've been trying but it doesn't seem to work either.
Got my mob to drop a saddle when you interact with it, got the code from EntitySheep. Its the code used when the player sheers the sheep...
Good find. There's another thing that I've not done in minecraft... sheering sheep. I'm not sure if I posted it yet, but I have made it so that my tamable mobs that can be mounted can require an item. With my code, it just checks to see if you have it in your inventory, that way you don't have to wory if it's in your hand or not.
Just got through scaling strenght, size (and bonding box) and speed by age. Will post the update soon.
Is this supposed to go to the Entity, or the mod file? I've been trying but it doesn't seem to work either.
Should go in the entity java file. This was just my most logical guess. I haven't tried it out yet. I'll try adding it to my gnome code and see. Should be a quick check.
[EDIT]
No, got it to work. The achievement is setup in the mod_ file. Remember that (and this is the only way I know how to do it) the added acheivements need to be stringed from existing ones. I did this:
KillGnome = (new Achievement(18, "KillaGnome", 2, 2, LanochiumSword, AchievementList.mineWood)).registerAchievement();
So I needed to do the GetWood achievement first. In my gnome entity file:
public void onDeath(Entity entity)
{
super.onDeath(entity); //run the orginal onDeath method
if(entity instanceof EntityPlayer) //did a player kill this?
{
EntityPlayer theplayer = (EntityPlayer)entity;
theplayer.addStat(mod_JWorld.KillGnome, 1); //Achievement... Achieved!
}
}
Worked like a charm. I opened my inventory (first acheivement), then I collected wood. After I turned to the nearest Gnome and put him down. Acheivement... um... Achieved!
Should go in the entity java file. This was just my most logical guess. I haven't tried it out yet. I'll try adding it to my gnome code and see. Should be a quick check.
[EDIT]
No, got it to work. The achievement is setup in the mod_ file. Remember that (and this is the only way I know how to do it) the added acheivements need to be stringed from existing ones. I did this:
KillGnome = (new Achievement(18, "KillaGnome", 2, 2, LanochiumSword, AchievementList.mineWood)).registerAchievement();
So I needed to do the GetWood achievement first. In my gnome entity file:
public void onDeath(Entity entity)
{
super.onDeath(entity); //run the orginal onDeath method
if(entity instanceof EntityPlayer) //did a player kill this?
{
EntityPlayer theplayer = (EntityPlayer)entity;
theplayer.addStat(mod_JWorld.KillGnome, 1); //Achievement... Achieved!
}
}
Worked like a charm. I opened my inventory (first acheivement), then I collected wood. After I turned to the nearest Gnome and put him down. Acheivement... um... Achieved!
Oh yea, a little bit of code made my achievement not work. Thanks :smile.gif:
Thanks for this killNature, a good find.
And yes techne can be used for any model type in minecraft. You could easily make a vehicle mob.
OLD 1.7: http://www.minecraftforum.net/topic/529327-modloader173-adding-custom-mobs-and-more/ ---inLanoche says : USE ECLIPSE
Make sure that your string name for the afropig call in the spawn block is "EXACTLY" the same as it is defined in your main mod_ java file. Looking at the spawn call you have it as "afropig". If it has captials or is spaced or something in it's definition, this code won't find it.
OLD 1.7: http://www.minecraftforum.net/topic/529327-modloader173-adding-custom-mobs-and-more/ ---inLanoche says : USE ECLIPSE
I have to say I love the way you explain the small bits of code and what they do. Too many tutorials just give a long code, "This code does this." Without an explanation of the individual smaller bits.
You haven't tried hard enough.
Edit: there is already an achievement for killing a monster. You could probably borrow that code and make it work.
Come on, bro, I got CREEPER BLOOD! (winning!)
I'm sure it's possible. You would have to run a check when it's killed. The (checking the entity that killed it, call the achievement:
entityplayer.addStat(KilledCow, 1);
(KilledCow would be the name of the achievement)
Just found it. Put it in here:
public void onEntityDeath()
{
}
the problem is checking for what killed it. Will have to look around for that. This would be an issue though for built in mobs, as you would have to change the code in it's entity file.
OLD 1.7: http://www.minecraftforum.net/topic/529327-modloader173-adding-custom-mobs-and-more/ ---inLanoche says : USE ECLIPSE
I've never spawned an item. Are you trying to put it right in the player's inventory? If so, you would first have to check for an empty slot. You check should include fail code (if no slots are free). I have not yet "spawned" items, so I'm not totally sure how that would work, maybe look at the code for when you break blocks. Just on my way out now, but thought I'd give a start for you.
OLD 1.7: http://www.minecraftforum.net/topic/529327-modloader173-adding-custom-mobs-and-more/ ---inLanoche says : USE ECLIPSE
I tried like this. It didn't give any errors or such. However in game no matter what i set the instance it doesn't give me the achievement. I tried it on pigs,cows and my own mobs too.
You don't need inventory in the mob. You just need to find the code to spawn an object at x,y,z. You'll have x,y,z from the entity droping the object, you just need to spawn the object at that point. I'll take a look at this in a bit.
OLD 1.7: http://www.minecraftforum.net/topic/529327-modloader173-adding-custom-mobs-and-more/ ---inLanoche says : USE ECLIPSE
I'm not there yet with my learning. Seems like you copied out the wolf code. Did you change anything/take anything out?
OLD 1.7: http://www.minecraftforum.net/topic/529327-modloader173-adding-custom-mobs-and-more/ ---inLanoche says : USE ECLIPSE
good idea, wrong method though. I like to look back to when these methods are called. If you look in entityliving, you see that that method is called in onDeath(). Also looking in the onDeath method, you can see that this is where a score is assigned, and would most likely be assigned to the killer. We don't need to really change that, but let's add to it:
OLD 1.7: http://www.minecraftforum.net/topic/529327-modloader173-adding-custom-mobs-and-more/ ---inLanoche says : USE ECLIPSE
Is this supposed to go to the Entity, or the mod file? I've been trying but it doesn't seem to work either.
Good find. There's another thing that I've not done in minecraft... sheering sheep. I'm not sure if I posted it yet, but I have made it so that my tamable mobs that can be mounted can require an item. With my code, it just checks to see if you have it in your inventory, that way you don't have to wory if it's in your hand or not.
Just got through scaling strenght, size (and bonding box) and speed by age. Will post the update soon.
OLD 1.7: http://www.minecraftforum.net/topic/529327-modloader173-adding-custom-mobs-and-more/ ---inLanoche says : USE ECLIPSE
Should go in the entity java file. This was just my most logical guess. I haven't tried it out yet. I'll try adding it to my gnome code and see. Should be a quick check.
[EDIT]
No, got it to work. The achievement is setup in the mod_ file. Remember that (and this is the only way I know how to do it) the added acheivements need to be stringed from existing ones. I did this:
So I needed to do the GetWood achievement first. In my gnome entity file:
Worked like a charm. I opened my inventory (first acheivement), then I collected wood. After I turned to the nearest Gnome and put him down. Acheivement... um... Achieved!
OLD 1.7: http://www.minecraftforum.net/topic/529327-modloader173-adding-custom-mobs-and-more/ ---inLanoche says : USE ECLIPSE
Oh yea, a little bit of code made my achievement not work. Thanks :smile.gif:
Good. I'm updating my video for the Tamable entity (and the code), I kill a gnome in there just for you.
OLD 1.7: http://www.minecraftforum.net/topic/529327-modloader173-adding-custom-mobs-and-more/ ---inLanoche says : USE ECLIPSE
After I made some blocks,I wanted to try to create my own passive mod, but i get these five errors: