The Meaning of Life, the Universe, and Everything.
Join Date:
8/9/2013
Posts:
211
Minecraft:
HappyKiller1O1
Xbox:
HappyKiller101
Member Details
Create the item stack, apply the enchantment to it, then put it in the currentArmor of the mob. Although, why are you using 1.6.4? It is way outdated, and will be very difficult to update if you continue with that version.
If you need an example of this in the source, check EntitySkeleton. I believe they were already able to hold enchanted bows in 1.6.4...
Though HappyKiller is correct- 1.6 is pretty outdated. It is an easier version to learn if you're just starting out, but you may want to look into upgrading to 1.7.10 soon
I can also export to 1.8 if it works(I learned from youth digital so the program exports and stuff so I cant update or anything I am not quite sure how it works)
I can also export to 1.8 if it works(I learned from youth digital so the program exports and stuff so I cant update or anything I am not quite sure how it works)
Oh, you did YD's program, too? That's how I learned to mod, lol
Unfortunately 1.7 is a big change from 1.6, and 1.8 is even bigger. 1.8 is... a pain in the tail, to say the least >.< I would upgrade to 1.7 first because that's one of the most used versions still and because 1.8 introduced a stupid amount of basically unnecessary changes. If you want a challenge, feel free to go with 1.8, but... don't say I didn't warn you. If you want to start a new mod from scratch, then it's probably OK to use 1.8 because you won't be trying to convert everything, but otherwise 1.8 is a pain.
Unfortunately, with 1.7, biomes became much harder to add. That's the one major thing that I found was REALLY hard to work around. I'd start by taking all your code from 1.6 and just copy-pasting it into 1.7. You're gonna get a crazy load of errors which will take time to fix, but once you've got that worked out, it'll be better.
After finishing with YD, I used a lot of internet tutorials to figure out how to do stuff. There are a ton of tutorials for 1.7 out there, so for most basic stuff (like entities) you'll be in pretty good shape. Jabelar, Wuppy, and Bedrockminer's tutorials are some of my favorites.
Also, the Minecraft source code is your friend. Yes, it can be a complicated, confusing mess with crazy variable names at times, but a lot of the time the people who make Forge have nicely renamed all those crazy names to things that people can actually understand. Reading through the source code for Minecraft will help you understand a lot more than even a lot of tutorials once you start to grasp how it works (which may take a while lol :P). But trust me- once you can understand the source code, you're in pretty good shape
The Meaning of Life, the Universe, and Everything.
Join Date:
8/9/2013
Posts:
211
Minecraft:
HappyKiller1O1
Xbox:
HappyKiller101
Member Details
What is this? You can't just call a void method that enchants a stack, and expect it to do something. You have to create the stack within the #currentItemAndArmor, then return that stack. If you're going to start modding, please get familiar with Java.
The Meaning of Life, the Universe, and Everything.
Join Date:
8/9/2013
Posts:
211
Minecraft:
HappyKiller1O1
Xbox:
HappyKiller101
Member Details
It's very simple actually. What you want to do is literally BASIC Java: create the stack, enchant the stack, give the stack. I gave you the proper code to complete your task, and you didn't use it. Don't blame Java, blame yourself for not looking into it more.
I am not blaming java it is just that I have taken java courses I have read java for dummies and none of that stuff helps with minecraft modding because it teaches lots of other stuff I just need a course that teaches only what is needed for modding like a java course that uses minecraft code to teach idk I just can't find a course that works for me so I guess I will just have to put up with everyone ignoring my threads because I can't learn java(even though I know java just not very much)if u could give me a REALLY good modding/java tutorial (preferably video) maybe I could get a little better idk maybe in 2 or 3 years I can look into java college or something like that. I guess I can always just use this anyway:
/** Creates an Explosive lightning bolt that
* sends the target flying through the air and sets it on fire */
public boolean hitEntity(ItemStack item, EntityLivingBase target, EntityLivingBase player)
{
/** Creates an Explosion */
// target.worldObj.createExplosion(target, target.posX, target.posY, target.posZ, 5.0F, true); // The size of the explosion
There is no one specific tutorial that teaches you everything you need to know. You have to be patient-- finding answers takes time. I find myself combing Google for tutorials and explanations almost every day I work on my mod, because there are still lots of things I don't know. Heck, I'm sure you've seen all the help threads I've flooded this forum with!
I wish I could help you more, but unfortunately I'm not familiar enough with 1.6. I do most of my work in 1.8 now, and before that I worked in 1.7.2. There's not as many tutorials for 1.6 that I've seen, so that may be difficult. All I can say is, if you're confused by the explanations here, do a little more research. There are some people out there who explain how things work in non-technical terms that are easy to understand. Jabelar, Bedrockminer, and some others are pretty good I've found. However, I'm not actually sure if they have any 1.6 tutorials.
The Meaning of Life, the Universe, and Everything.
Join Date:
8/9/2013
Posts:
211
Minecraft:
HappyKiller1O1
Xbox:
HappyKiller101
Member Details
What you're attempting to do is a basic functionality of Java itself. I started programming with Minecraft mods by looking up every tutorial I could on YouTube, and looking through the Minecraft forge docs. ScratchForFun has a very good series on Minecraft modding, but it will take a good few years to understand how most of Minecraft works. I feel I am too familiar with Java, so I do not understand how it feels to first be learning it, so for that I am very sorry. Just search YouTube for some modding tutorials, and look up the Java stuff you want to research. A lot of my trouble came with things called Vector3's. I never could quite understand what they did until I got into game development, which explained a lot. If you're interested in that, a Vector3 is a 3D point in space (x, y, z), BUT it can also hold the rotation, and scale of an object. Whenever you see something like "Vector3.normalize", this means they are retrieving the rotation of the object, and not the position. Anyway, try just starting a project and setting a bunch of completely outrageous goals for it, then try to achieve them. If you can't, you still learned a whole lot about how that certain aspect works, and solved a lot of problems. Goodluck!
It already holds the sword but how do I make it enchanted
package mymod.entity.zombie;
import mymod.Main;
import net.minecraft.entity.EntityAgeable;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.monster.EntityMob;
import net.minecraft.entity.monster.EntityZombie;
import net.minecraft.entity.passive.EntityAnimal;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
public class MyEntityKZombie extends EntityZombie
{
public MyEntityKZombie(World par1World)
{
super(par1World);
this.setSize(0.9F, 1.3F);
}
protected void applyEntityAttributes()
{
super.applyEntityAttributes();
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setAttribute(0.1D);
this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setAttribute(0.0D);
}
/**
* Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig.
*/
public boolean interact(EntityPlayer par1EntityPlayer)
{
return false;
}
protected void dropRareDrop(int par1)
{
this.dropItem(Main.MyKSword_1.itemID, 1);
}
/**
* Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param
* par2 - Level of Looting used to kill this mob.
*/
protected void dropFewItems(boolean par1, int par2)
{
int j = this.rand.nextInt(2 + par2);
int k;
for (k = 0; k < j; ++k)
{
this.dropItem(Item.rottenFlesh.itemID, 1);
}
j = this.rand.nextInt(2 + par2);
for (k = 0; k < j; ++k)
{
this.dropItem(Main.MyItem_2.itemID, 1);
}
}
/**
* Makes entity wear random armor based on difficulty
*/
protected void addRandomArmor()
{
this.setCurrentItemOrArmor(0, new ItemStack(Main.MyKSword_1));
}
public boolean isAIEnabled()
{
return true;
}
}
Create the item stack, apply the enchantment to it, then put it in the currentArmor of the mob. Although, why are you using 1.6.4? It is way outdated, and will be very difficult to update if you continue with that version.
If you need an example of this in the source, check EntitySkeleton. I believe they were already able to hold enchanted bows in 1.6.4...
Though HappyKiller is correct- 1.6 is pretty outdated. It is an easier version to learn if you're just starting out, but you may want to look into upgrading to 1.7.10 soon
Even if it's easier to learn, you'll have to re-learn a bunch when updating to 1.7.10.
True, but it can help you get a better understanding of Java in general- principles that apply to any version.
I can also export to 1.8 if it works(I learned from youth digital so the program exports and stuff so I cant update or anything I am not quite sure how it works)
Oh, you did YD's program, too? That's how I learned to mod, lol
Unfortunately 1.7 is a big change from 1.6, and 1.8 is even bigger. 1.8 is... a pain in the tail, to say the least >.< I would upgrade to 1.7 first because that's one of the most used versions still and because 1.8 introduced a stupid amount of basically unnecessary changes. If you want a challenge, feel free to go with 1.8, but... don't say I didn't warn you. If you want to start a new mod from scratch, then it's probably OK to use 1.8 because you won't be trying to convert everything, but otherwise 1.8 is a pain.
Here's a tutorial on setting up a workspace for 1.7:
http://www.minecraftforum.net/forums/mapping-and-modding/mapping-and-modding-tutorials/1571599-1-7-x-modding-with-forge-1-jdk-eclipse-forge-and
Unfortunately, with 1.7, biomes became much harder to add. That's the one major thing that I found was REALLY hard to work around. I'd start by taking all your code from 1.6 and just copy-pasting it into 1.7. You're gonna get a crazy load of errors which will take time to fix, but once you've got that worked out, it'll be better.
After finishing with YD, I used a lot of internet tutorials to figure out how to do stuff. There are a ton of tutorials for 1.7 out there, so for most basic stuff (like entities) you'll be in pretty good shape. Jabelar, Wuppy, and Bedrockminer's tutorials are some of my favorites.
Also, the Minecraft source code is your friend. Yes, it can be a complicated, confusing mess with crazy variable names at times, but a lot of the time the people who make Forge have nicely renamed all those crazy names to things that people can actually understand. Reading through the source code for Minecraft will help you understand a lot more than even a lot of tutorials once you start to grasp how it works (which may take a while lol :P). But trust me- once you can understand the source code, you're in pretty good shape
still cant figure it out I tried this but didnt work
protected void addEnchantment(ItemStack item)
{
item.addEnchantment(Enchantment.knockback, 1);
}
do you think something like that could work
Very close. Basically, do something like this:
Not sure if ItemStack has the addEnchantment method, but you get the gist of it.
can't get it to work is there a way to boost the knockback power of the mob itself
Please, show how you're doing it. This worked just fine for me.
{
ItemStack stack = new ItemStack(Main.MyKSword_1, 1, 0);
stack.addEnchantment(Enchantment.knockback, 1);
}
What is this? You can't just call a void method that enchants a stack, and expect it to do something. You have to create the stack within the #currentItemAndArmor, then return that stack. If you're going to start modding, please get familiar with Java.
sorry that there is no freaking way to learn java that actually works!
It's very simple actually. What you want to do is literally BASIC Java: create the stack, enchant the stack, give the stack. I gave you the proper code to complete your task, and you didn't use it. Don't blame Java, blame yourself for not looking into it more.
I am not blaming java it is just that I have taken java courses I have read java for dummies and none of that stuff helps with minecraft modding because it teaches lots of other stuff I just need a course that teaches only what is needed for modding like a java course that uses minecraft code to teach idk I just can't find a course that works for me so I guess I will just have to put up with everyone ignoring my threads because I can't learn java(even though I know java just not very much)if u could give me a REALLY good modding/java tutorial (preferably video) maybe I could get a little better idk maybe in 2 or 3 years I can look into java college or something like that. I guess I can always just use this anyway:
/** Creates an Explosive lightning bolt that
* sends the target flying through the air and sets it on fire */
public boolean hitEntity(ItemStack item, EntityLivingBase target, EntityLivingBase player)
{
/** Creates an Explosion */
// target.worldObj.createExplosion(target, target.posX, target.posY, target.posZ, 5.0F, true); // The size of the explosion
/** Summons a Lightning Bolt */
// target.worldObj.addWeatherEffect(new EntityLightningBolt(target.worldObj, target.posX, target.posY, target.posZ));
/** Sends the target flying through the air */
target.addVelocity(1, 0, 1); // The middle number is the upwards velocity
/** Sets the target on Fire */
// target.setFire(10); // The number of ticks it will be on fire
return true;
}
nope that only works if the player is using the sword
There is no one specific tutorial that teaches you everything you need to know. You have to be patient-- finding answers takes time. I find myself combing Google for tutorials and explanations almost every day I work on my mod, because there are still lots of things I don't know. Heck, I'm sure you've seen all the help threads I've flooded this forum with!
I wish I could help you more, but unfortunately I'm not familiar enough with 1.6. I do most of my work in 1.8 now, and before that I worked in 1.7.2. There's not as many tutorials for 1.6 that I've seen, so that may be difficult. All I can say is, if you're confused by the explanations here, do a little more research. There are some people out there who explain how things work in non-technical terms that are easy to understand. Jabelar, Bedrockminer, and some others are pretty good I've found. However, I'm not actually sure if they have any 1.6 tutorials.
What you're attempting to do is a basic functionality of Java itself. I started programming with Minecraft mods by looking up every tutorial I could on YouTube, and looking through the Minecraft forge docs. ScratchForFun has a very good series on Minecraft modding, but it will take a good few years to understand how most of Minecraft works. I feel I am too familiar with Java, so I do not understand how it feels to first be learning it, so for that I am very sorry. Just search YouTube for some modding tutorials, and look up the Java stuff you want to research. A lot of my trouble came with things called Vector3's. I never could quite understand what they did until I got into game development, which explained a lot. If you're interested in that, a Vector3 is a 3D point in space (x, y, z), BUT it can also hold the rotation, and scale of an object. Whenever you see something like "Vector3.normalize", this means they are retrieving the rotation of the object, and not the position. Anyway, try just starting a project and setting a bunch of completely outrageous goals for it, then try to achieve them. If you can't, you still learned a whole lot about how that certain aspect works, and solved a lot of problems. Goodluck!