I believe I have come with system. By using the same code that is used for crafting/workbench, I could create a gui to work the same way and then I could create a java named TradeValues.java with recipes that are different combinations of to work as a currency. So for example let say that the user wants to "buy" a wooden sword they would need 2 and if they wan't to "sell" their wooden sword they would get back 1 instead of 2 due to depreciation. Its not exactly what I wan't but it's a start. And of course I can see some limitations with the same i.e theirs is a limited amount of combinations etc. But it should work for now.
I would set a monitary level for each item. so for say :Iron:, it's value could be 1, for it's value could be 10, and for it' value can be 50. You could define this in a 2D array in your main mod_ java file. You could also make a list for all the items and give them 2 values, a buy and sell. This is how I would go at it.
You could do it the crafting way, though I have not created specialty crafting tables, nor do I know if it's possible for these recipes to be handled only by your table. I did see a tutorial on a furnace with 2 inputs or outputs (I can't remember), you may want to start there.
Thanks, that fixed the errors, but when i kill the entity a pig doesnt spawn...
not quite sure whats wrong :/
Might be where you are getting your worldObj from. Also why do you check if entity is instanceof EntityPlayer? You need to explain more on what you are doing. Are you trying to spawn a pig only when the player kills this mob? You need to give more about what you are doing before I can help more.
For now, I would drop the instanceof check. Just go basically with if this entity dies, spawn a new pig. Also, if that is not working, get the world object a different way:
Minecraft mc = ModLoader.ModLoader.getMinecraftInstance();
World world = mc.theWorld;
[edit]
If you are trying to mod 1.8 (please read that this thread is for 1.7.3) then you need to go back and find the source for you code. I tried what you where doing and was wondering why it wasn't working. So I went and took a look at the code (now this is for 1.8) and noticed (in EntityLiving, which is where the onDeath() method originates) that the code needs to follow this format:
public void onDeath(DamageSource damagesource)
So if you attempt to give it different Args, then the onDeath call will not use your code. I did this, and it worked:
public void onDeath(DamageSource damagesource)
{
super.onDeath(damagesource);
Minecraft mc = ModLoader.getMinecraftInstance();
World world = mc.theWorld;
EntityLiving entityliving = (EntityLiving)EntityList.createEntityInWorld("Pig", world);
entityliving.setLocationAndAngles(posX, posY, posZ, 0F, 0F); //x, y, z, yaw, pitch
world.entityJoinedWorld(entityliving);
}
if you are using 1.7.3, go and look at how the code for onDeath in EntityLiving. You should also call the super (like I did here) to make sure that all the other stuff that happens at death are handled.
How do you resize the texture in techne is the texture is bigger that the white screen? I'm sorry if I sound like a complete noob. :sad.gif: I am just seeking some helpful advice.
How do you resize the texture in techne is the texture is bigger that the white screen? I'm sorry if I sound like a complete noob. :sad.gif: I am just seeking some helpful advice.
It's been a while since I used Techne, but I beleive that the texture size needs to be 64x32. If it has been upgraded since, you might get away with multiples (base 2) of this which the game will accept (128x64, 256x128). If not use a 64x32,as a place holder, then use the same area in a larger map for what is used in game
So there is a few new more things I want to learn.
1. How to control an Entity's movements like make it move side to side or moonwalk when attacked. Also, to make it teleport like how the new way the enderman will teleport in 1.9 like it teleports to different sides of you before you attack.
2. Make is spawn other entitys when attacked.
3. Make your own fireball or arrow.
4. Making a new dimension.
5. Making things generate like a Mo Creeps and Weirdos Castle or a stronghold.
Also, on my own I've made my own Biome ( without modloader because it's easier ) but whenever my client loads the biome it crashed. i cannot provide you with the code because I quickly deleted the code.
I would really appreciate it if you could provide these codes.
Hey there. I've been following along with this Tutorial in 1.8.1 (yes I know there are going to be problems, but I'm an alright programmer, I can overcome!)
Anyway I've run into a sort of odd issue where the game renders the model twice over. Here's a pic demonstating the issue.
It does this with all the body parts (sorry I havent been able to texture it yet, but it's there).
its in the model code.public class ModelTestMob extends ModelBiped.it adds the average human model to your model, chaneg the modelbiped to modelbase.
Changing it to ModelBase will stop all animation to it while walking, but I take your point, all I need to add was the custom stuff (ears and antennae) and it works fine. I just need to fix the rotations of the ears and antennae to follow perfectly with the head now.
This is way too hard for a 13 year old who learned java a year ago, so all I can really do it create a recipe and summoner items which might not even work. Feel free to help. P.S. minecart chests wont follow you through caves, or attack mobs for you when given swords, opps too many spoilers XD.
I am a 10 year old that started java a month ago and understands this. Problem?
It is not too hard. These tutorials are excellent.
you negate the rotation you set for the leftear. But if you don't the ear will float in space, and not rotate with the head. BUT if you specifiy this in the setRotationAngle method:
then it will follow the head's x rotation + the 20 degrees (0.3490658F radians).
First, let me say your tutorials have been very helpful.
I followed your advice above about getting attached objects to rotate together properly, and it worked in getting the jointed legs of my mob to rotate correctly.
However, I can't seem to get the horns on my mob's head to do the same. Each horn consists of two parts and all of them have the same rotation point as the head, and they all have initial x, y, and z rotations. I'm using the method you suggested (and it worked for the legs), but the horns are still rotating incorrectly and not in unison with the head. Any idea what might be going wrong?
Here's the part of the model file where I set the horn rotation:
Hey, I followed the entire tutorial, and tried to make a Rhino. The sounds work, it will attack if attacked, but the problem is, it uses the ModelBiped. I dont know why. Like, it has the Players model, but it uses the Rhinos texture map. Some Help would be appreciated.
Hey, I followed the entire tutorial, and tried to make a Rhino. The sounds work, it will attack if attacked, but the problem is, it uses the ModelBiped. I dont know why. Like, it has the Players model, but it uses the Rhinos texture map. Some Help would be appreciated.
I would set a monitary level for each item. so for say :Iron:, it's value could be 1, for it's value could be 10, and for it' value can be 50. You could define this in a 2D array in your main mod_ java file. You could also make a list for all the items and give them 2 values, a buy and sell. This is how I would go at it.
You could do it the crafting way, though I have not created specialty crafting tables, nor do I know if it's possible for these recipes to be handled only by your table. I did see a tutorial on a furnace with 2 inputs or outputs (I can't remember), you may want to start there.
OLD 1.7: http://www.minecraftforum.net/topic/529327-modloader173-adding-custom-mobs-and-more/ ---inLanoche says : USE ECLIPSE
not quite sure whats wrong :/
Might be where you are getting your worldObj from. Also why do you check if entity is instanceof EntityPlayer? You need to explain more on what you are doing. Are you trying to spawn a pig only when the player kills this mob? You need to give more about what you are doing before I can help more.
For now, I would drop the instanceof check. Just go basically with if this entity dies, spawn a new pig. Also, if that is not working, get the world object a different way:
Minecraft mc = ModLoader.ModLoader.getMinecraftInstance();
World world = mc.theWorld;
[edit]
If you are trying to mod 1.8 (please read that this thread is for 1.7.3) then you need to go back and find the source for you code. I tried what you where doing and was wondering why it wasn't working. So I went and took a look at the code (now this is for 1.8) and noticed (in EntityLiving, which is where the onDeath() method originates) that the code needs to follow this format:
public void onDeath(DamageSource damagesource)
So if you attempt to give it different Args, then the onDeath call will not use your code. I did this, and it worked:
if you are using 1.7.3, go and look at how the code for onDeath in EntityLiving. You should also call the super (like I did here) to make sure that all the other stuff that happens at death are handled.
OLD 1.7: http://www.minecraftforum.net/topic/529327-modloader173-adding-custom-mobs-and-more/ ---inLanoche says : USE ECLIPSE
Anyways..your code worked thanks! :biggrin.gif:
It's been a while since I used Techne, but I beleive that the texture size needs to be 64x32. If it has been upgraded since, you might get away with multiples (base 2) of this which the game will accept (128x64, 256x128). If not use a 64x32,as a place holder, then use the same area in a larger map for what is used in game
OLD 1.7: http://www.minecraftforum.net/topic/529327-modloader173-adding-custom-mobs-and-more/ ---inLanoche says : USE ECLIPSE
1. How to control an Entity's movements like make it move side to side or moonwalk when attacked. Also, to make it teleport like how the new way the enderman will teleport in 1.9 like it teleports to different sides of you before you attack.
2. Make is spawn other entitys when attacked.
3. Make your own fireball or arrow.
4. Making a new dimension.
5. Making things generate like a Mo Creeps and Weirdos Castle or a stronghold.
Also, on my own I've made my own Biome ( without modloader because it's easier ) but whenever my client loads the biome it crashed. i cannot provide you with the code because I quickly deleted the code.
I would really appreciate it if you could provide these codes.
like this
I don't cheat; I just conveniently write the rules.
Oops, did I steal your mod? Well, I'm lazy, so if I found the motivation to do so, you did something wrong as a developer.
Additional Buildcraft Objects: http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/2310397
I'm currently also working on Remain in Motion. http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/2104611
I can't advertise the others....
My Patreon: https://www.patreon.com/DA3DSOUL
Anyway I've run into a sort of odd issue where the game renders the model twice over. Here's a pic demonstating the issue.
It does this with all the body parts (sorry I havent been able to texture it yet, but it's there).
Anyway, here are my sources:
ModelTestMob.java
RenderTestMob.java
EntityTestMob
The code all looks right, so it's probably something to do with the logic. Has anyone else come across this in their travels?
Changing it to ModelBase will stop all animation to it while walking, but I take your point, all I need to add was the custom stuff (ears and antennae) and it works fine. I just need to fix the rotations of the ears and antennae to follow perfectly with the head now.
Thanks for your help. :smile.gif:
I am a 10 year old that started java a month ago and understands this. Problem?
It is not too hard. These tutorials are excellent.
First, let me say your tutorials have been very helpful.
I followed your advice above about getting attached objects to rotate together properly, and it worked in getting the jointed legs of my mob to rotate correctly.
However, I can't seem to get the horns on my mob's head to do the same. Each horn consists of two parts and all of them have the same rotation point as the head, and they all have initial x, y, and z rotations. I'm using the method you suggested (and it worked for the legs), but the horns are still rotating incorrectly and not in unison with the head. Any idea what might be going wrong?
Here's the part of the model file where I set the horn rotation:
The lhLeftX, uhLeftx, etc. variables are the initial rotation values for those parts.
It helps me very much :smile.gif:
ModelRhino Code:
P.S. can you approve meh comment? I want to be able to post more... :biggrin.gif:
Well, I was making a rhino too. What you do is: