EDIT: I had a problem, but I worked around it. Nice tutorials by the way
EDIT2: I now have a real problem. In your Ore tutorial, I can't start a world because in the MODNAMEWorldGeneration class, x and z cannot be resolved to a variable.
private void generateNether(World world, Random random, int i, int j) {
// TODO Auto-generated method stub
}
private void generateEnd(World world, Random random, int i, int j) {
// TODO Auto-generated method stub
}
privatevoid addOreSpawn(Block block, World world, Random random, intblockXPos, intblockZPos, intmaxX, intmaxZ, intmaxVeinSize, intchanceToSpawn, intminY, intmaxY)
{
for (int i = 0; i < chanceToSpawn; i++)
{
intposX = blockXPos + random.nextInt(maxX);
int posY = minY + random.nextInt(maxY - minY);
intposZ = blockZPos + random.nextInt(maxZ);
new WorldGenMinable(block, maxVeinSize).generate(world, random, posX, posY, posZ);
}
}
}
Ah. Since the generateSurface method was auto-generated, Java automatically assigned the two int parameters to 'i' and 'j'. Either change those two parameters to x and y, or change the x and y to i and j.
Why is everyone only making 1.7.X Tutorials alot changed in 1.8 please make 1.8 Armor Tutorials and more no one makes them except MrCrayFish and he is not making them right now so please
Why is everyone only making 1.7.X Tutorials alot changed in 1.8 please make 1.8 Armor Tutorials and more no one makes them except MrCrayFish and he is not making them right now so please
I'll eventually upgrade to 1.8 whenever my own mods update. I haven't looked into 1.8 at all yet, and need to learn what all has changed. As for when I'll upgrade to 1.8, I would assume near the end of March.
Hey was wondering if you could give me a hand with custom drops from mobs I haven't been able to find a tutorial that covers what I'm looking for.
I have already set a custom mob drop for vanilla pigs to drop "pig skin" (like a pig equivalent of leather)
What I want to do next is have a new custom drop override all other drops for vanilla cows and pigs so
if item used = custom item drop new custom item (instead of leather and beef / pig skin and pork chop respectively)
the idea being if this specific item is used against pig/cow an itemized live mob (customized pig/cow egg basically with a living mob Icon) will be dropped allowing this to be used as a tool of farming, gathering and transporting living mobs (only cow and pig at this point)
I'm not sure how I might achieve this as am relatively new to making my own mods
Hey was wondering if you could give me a hand with custom drops from mobs I haven't been able to find a tutorial that covers what I'm looking for.
I have already set a custom mob drop for vanilla pigs to drop "pig skin" (like a pig equivalent of leather)
What I want to do next is have a new custom drop override all other drops for vanilla cows and pigs so
if item used = custom item drop new custom item (instead of leather and beef / pig skin and pork chop respectively)
the idea being if this specific item is used against pig/cow an itemized live mob (customized pig/cow egg basically with a living mob Icon) will be dropped allowing this to be used as a tool of farming, gathering and transporting living mobs (only cow and pig at this point)
I'm not sure how I might achieve this as am relatively new to making my own mods
Thanks in advance for any help
You can use the LivingDropsEvent to control the drops of mobs. If you aren't already using this event to drop items from the pig, I would switch over to that. I'm also a little lost as to what you are specifically trying to do.
You can use the LivingDropsEvent to control the drops of mobs. If you aren't already using this event to drop items from the pig, I would switch over to that. I'm also a little lost as to what you are specifically trying to do.
Yes already using LivingDropsEvent to add "pig skin" to pig drops... so currently pigs drop both "pig skin" and "pork chop" that isn't an issue.
Sorry if came across a little confusing,
I have a custom tool "mob catcher" what i want is for pigs and cows killed with "mob catcher" to drop a new custom item and not drop any of the normal items (pig skin/porkchop and leather/beef)
What I like to say is anything Java can do, you can do, so yes, it is possible. Forge may limit something, but I am unaware of anything that would. As for how to do this, I would have to look into it a bit. There are two routes you can take to figuring out this: one being finding something that Minecraft already implements (e.g. a pickaxe will allow blocks to drop, whereas a sword doesn't), and the second one being finding an open source mod which does something similar.
Again, I'll still look around for any methods that would be useful.
I think the closest thing to what I'm thinking would be a silk touch tool which overrides the normal block drop, though i don't want this to happen for just any tool only this particular one, so would that require i create a custom enchantment for this special item and then set the new drop as a response to this "custom silk touch"??
Again pretty new to this so any help is greatly appreciated
I think the closest thing to what I'm thinking would be a silk touch tool which overrides the normal block drop, though i don't want this to happen for just any tool only this particular one, so would that require i create a custom enchantment for this special item and then set the new drop as a response to this "custom silk touch"??
Again pretty new to this so any help is greatly appreciated
No, there would be a much easier way than creating an enchantment. You will be better of posting this in the Modification Development section, as you'll get help from several different people instead of just me. You'll have to manipulate events to get this to work, I just need to find out how, but don't have a lot of time on my hands.
I am getting 2 errors by my ModTabs, when creating the second class I get the error by "omega" and "ModStructureItems"I changed the the AscensionTab to to TheBadLandsTab, if that does anything. And thank you so much for these Turtorials, really love them.
Kind Regards BubbleTrouble
Those are my examples - change them to what you want.
Ok, thank you. And I also would like to know how it works to give the Armors Textures, didn't really understand what u meant.
The Armor is technically a model (which I will cover in later tutorials), so all that we need to do is just make a texture for the armor. We set the texture using Item#getArmorTexture which gets called in the RenderBiped and RenderPlayer classes to actually render the texture on the armor model. Item#getArmorTexture returns a String, so we just put the file hierarchy of our texture into that String so it can be read properly. The if and else statements determine what texture goes with what armor item.
Yes already using LivingDropsEvent to add "pig skin" to pig drops... so currently pigs drop both "pig skin" and "pork chop" that isn't an issue.
Sorry if came across a little confusing,
I have a custom tool "mob catcher" what i want is for pigs and cows killed with "mob catcher" to drop a new custom item and not drop any of the normal items (pig skin/porkchop and leather/beef)
is that possible?
Look at the EntitySkeleton#onDeath method. You should be able to spawn the entity (drop) you want when the mob dies because you can use DamageSource.getSourceOfDamage and check if it was your weapon that killed the mob. Not sure if this will work, but it is just something that I found.
Look at the EntitySkeleton#onDeath method. You should be able to spawn the entity (drop) you want when the mob dies because you can use DamageSource.getSourceOfDamage and check if it was your weapon that killed the mob. Not sure if this will work, but it is just something that I found.
Have you implemented IWorldGenerator?
Here's the entire class:
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.world.World;
import net.minecraft.world.chunk.IChunkProvider;
import net.minecraft.world.gen.feature.WorldGenMinable;
import com.gmail.willpharper.mods.Rayathite.init.ModBlocks;
import cpw.mods.fml.common.IWorldGenerator;
public class RayathiteWorldGeneration implements IWorldGenerator
{
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
{
switch (world.provider.dimensionId)
{
case 0:
generateSurface(world, random, chunkX * 16, chunkZ * 16);
case -1:
generateNether(world, random, chunkX * 16, chunkZ * 16);
case 1:
generateEnd(world, random, chunkX * 16, chunkZ * 16);
}
}
private void generateSurface(World world, Random random, int i, int j) {
// TODO Auto-generated method stub
addOreSpawn(ModBlocks.rayathiteOre, world, random, x, z, 16, 16, 2 + random.nextInt(3), 9, 0, 48);
}
private void generateNether(World world, Random random, int i, int j) {
// TODO Auto-generated method stub
}
private void generateEnd(World world, Random random, int i, int j) {
// TODO Auto-generated method stub
}
privatevoid addOreSpawn(Block block, World world, Random random, intblockXPos, intblockZPos, intmaxX, intmaxZ, intmaxVeinSize, intchanceToSpawn, intminY, intmaxY)
{
for (int i = 0; i < chanceToSpawn; i++)
{
intposX = blockXPos + random.nextInt(maxX);
int posY = minY + random.nextInt(maxY - minY);
intposZ = blockZPos + random.nextInt(maxZ);
new WorldGenMinable(block, maxVeinSize).generate(world, random, posX, posY, posZ);
}
}
}
Ah. Since the generateSurface method was auto-generated, Java automatically assigned the two int parameters to 'i' and 'j'. Either change those two parameters to x and y, or change the x and y to i and j.
I'll eventually upgrade to 1.8 whenever my own mods update. I haven't looked into 1.8 at all yet, and need to learn what all has changed. As for when I'll upgrade to 1.8, I would assume near the end of March.
I have already set a custom mob drop for vanilla pigs to drop "pig skin" (like a pig equivalent of leather)
What I want to do next is have a new custom drop override all other drops for vanilla cows and pigs so
if item used = custom item drop new custom item (instead of leather and beef / pig skin and pork chop respectively)
the idea being if this specific item is used against pig/cow an itemized live mob (customized pig/cow egg basically with a living mob Icon) will be dropped allowing this to be used as a tool of farming, gathering and transporting living mobs (only cow and pig at this point)
I'm not sure how I might achieve this as am relatively new to making my own mods
Thanks in advance for any help
You can use the LivingDropsEvent to control the drops of mobs. If you aren't already using this event to drop items from the pig, I would switch over to that. I'm also a little lost as to what you are specifically trying to do.
Yes already using LivingDropsEvent to add "pig skin" to pig drops... so currently pigs drop both "pig skin" and "pork chop" that isn't an issue.
Sorry if came across a little confusing,
I have a custom tool "mob catcher" what i want is for pigs and cows killed with "mob catcher" to drop a new custom item and not drop any of the normal items (pig skin/porkchop and leather/beef)
is that possible?
Again, I'll still look around for any methods that would be useful.
I think the closest thing to what I'm thinking would be a silk touch tool which overrides the normal block drop, though i don't want this to happen for just any tool only this particular one, so would that require i create a custom enchantment for this special item and then set the new drop as a response to this "custom silk touch"??
Again pretty new to this so any help is greatly appreciated
No, there would be a much easier way than creating an enchantment. You will be better of posting this in the Modification Development section, as you'll get help from several different people instead of just me. You'll have to manipulate events to get this to work, I just need to find out how, but don't have a lot of time on my hands.
Those are my examples - change them to what you want.
The Armor is technically a model (which I will cover in later tutorials), so all that we need to do is just make a texture for the armor. We set the texture using Item#getArmorTexture which gets called in the RenderBiped and RenderPlayer classes to actually render the texture on the armor model. Item#getArmorTexture returns a String, so we just put the file hierarchy of our texture into that String so it can be read properly. The if and else statements determine what texture goes with what armor item.
Hopefully that makes a bit more sense.
Look at the EntitySkeleton#onDeath method. You should be able to spawn the entity (drop) you want when the mob dies because you can use DamageSource.getSourceOfDamage and check if it was your weapon that killed the mob. Not sure if this will work, but it is just something that I found.
What is the problem?
Awesome thanks will look into that
Set the time longer.