i just did the armor tutorial and i was wondering is there a way to decrease the amount of damage you take when wearing the armor by more then the default and also i was wondering if you or anyone else knew how to make it so when wearing the full set of armour it stops fall damage??? or a block that stops fall damage becuz i got the bouncy block and its not fun to die :tongue.gif: but anyways keep up the tutorials there great and help a ton :biggrin.gif:
Its just to seperate the code. I like to do that once i have big hunks of code that does one thing, then the next thng im gunna do is completly different. I learnt that from my dad. He does webprograming. :biggrin.gif: He know alot of languages but the one hes best at is PHP, and JQuary.
Although, he doesnt know java, so no help from there D:
this code will allow you to place the chest and put items in it. In order to generate the chest where you want it add integers to the i, j, k like Madgoblin said in his tutorial. Make sure the values are the same for both instances of the i, j, k. Then chunk this method in after the generate method.
This method will tell the chest what items to have inside it. This code is the one used in dungeons so you can mess around with it to get the items you want in your chest.
Thanks the first one worked. Then I tried the second one to see what it would do and minecraft crashed.
Odd, I was sure I did it correctly. Still if I didn't you could try this:
for (;world.getBlockId(i,j,k) == 0;++j) {}
j--;
Keep in mind the other might be right but your code generation is too complex or uses variables or something that could interfere or conflict with this. I can't be sure since I don't have that code in front of me.
Odd, I was sure I did it correctly. Still if I didn't you could try this:
for (;world.getBlockId(i,j,k) == 0;++j) {}
j--;
Keep in mind the other might be right but your code generation is too complex or uses variables or something that could interfere or conflict with this. I can't be sure since I don't have that code in front of me.
Ya I think my code is too complex but the first one works fine so I'm happy. :smile.gif:
I will try the code with a simpler code.
Odd, I was sure I did it correctly. Still if I didn't you could try this:
for (;world.getBlockId(i,j,k) == 0;++j) {}
j--;
Keep in mind the other might be right but your code generation is too complex or uses variables or something that could interfere or conflict with this. I can't be sure since I don't have that code in front of me.
I just tried your code with a simpler one block generation and minecraft still crashed.
package net.minecraft.src;
import java.util.*;
import java.util.Random;
public class mod_MerkgamerSC2 extends BaseMod
{
public static final Item PsiBlade = new ItemPsiBlade(1505, 0).setItemName("PsiBlade");
public static final Item PsiBladeShard = new ItemPsiBladeShard(1506, 0).setItemName("PsiBladeShard");
public static final Item GasContainer = new Item(1504).setItemName("GasContainer");
public static final Item Gas = new ItemGas(1503, 0).setItemName("Gas");
public static final Item MineralShard = new ItemFood(1501, 3, false).setItemName("MineralShard");
public static final Item MineralChunk = new Item(1500).setItemName("MineralChunk");
public static final BlockFlower MineralOre = (BlockFlower) new BlockFlower(180, 0).setHardness(0.5F).setStepSound(Block.soundGlassFootstep).setBlockName("MineralOre");
public static final Item HarvesterPickaxe = new ItemPickaxeHarvester(1502, EnumToolHarvester.HARVESTER).setItemName("Harvester");
public mod_MerkgamerSC2()
{
ModLoader.RegisterEntityID(EntityZealot.class, "Zealot", ModLoader.getUniqueEntityId());
ModLoader.RegisterBlock(MineralOre);
ModLoader.AddName(PsiBladeShard, "PsiBladeEssence");
ModLoader.AddName(PsiBlade, "PsiBlade");
ModLoader.AddName(GasContainer, "GasContainer");
ModLoader.AddName(Gas, "Gas");
ModLoader.AddName(HarvesterPickaxe, "Harvester");
ModLoader.AddName(MineralOre, "MineralOre");
ModLoader.AddName(MineralShard, "MineralShard");
ModLoader.AddName(MineralChunk, "MineralChunk");
PsiBladeShard.iconIndex = ModLoader.addOverride("/gui/items.png", "/Merkgamer/PsiBladeShard.png");
PsiBlade.iconIndex = ModLoader.addOverride("/gui/items.png", "/Merkgamer/PsiBlade.png");
GasContainer.iconIndex = ModLoader.addOverride("/gui/items.png", "/Merkgamer/GasContainer.png");
Gas.iconIndex = ModLoader.addOverride("/gui/items.png", "/Merkgamer/Gas.png");
MineralOre.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/Merkgamer/Mineral.png");
MineralShard.iconIndex = ModLoader.addOverride("/gui/items.png", "/Merkgamer/MineralShard.png");
MineralChunk.iconIndex = ModLoader.addOverride("/gui/items.png", "/Merkgamer/MineralChunk.png");
HarvesterPickaxe.iconIndex = ModLoader.addOverride("/gui/items.png", "/Merkgamer/Harvester.png");
ModLoader.AddSpawn("Zealot", 3, EnumCreatureType.monster, new BiomeGenBase[] {
BiomeGenBase.iceDesert,
BiomeGenBase.taiga,
BiomeGenBase.forest,
BiomeGenBase.plains,
BiomeGenBase.rainforest,
BiomeGenBase.tundra,
});
ModLoader.AddRecipe(new ItemStack(MineralShard, 2), new Object [] {
" ", " X ", " ",
Character.valueOf('X'), MineralOre
});
ModLoader.AddRecipe(new ItemStack(MineralChunk, 1), new Object [] {
"XXX", "X X", "XXX",
Character.valueOf('X'), MineralOre
});
ModLoader.AddRecipe(new ItemStack(MineralShard, 18), new Object [] {
"XXX", "XXX", "XXX",
Character.valueOf('X'), MineralOre
});
ModLoader.AddRecipe(new ItemStack(HarvesterPickaxe, 1), new Object [] {
" M ", "GDG", " D ",
Character.valueOf('M'), MineralChunk,
Character.valueOf('G'), GasContainer,
Character.valueOf('D'), Item.ingotIron,
});
ModLoader.AddRecipe(new ItemStack(GasContainer, 1), new Object [] {
"XXX", "XXX", "XXX",
Character.valueOf('X'), Gas
});
ModLoader.AddRecipe(new ItemStack(PsiBlade, 1), new Object [] {
"PMP", "PMP", " I ",
Character.valueOf('P'), PsiBladeShard,
Character.valueOf('M'), MineralChunk,
Character.valueOf('I'), Item.ingotIron,
});
}
public String Version ()
{
return"1.7.3";
}
public void AddRenderer(Map map)
{
map.put(EntityZealot.class, new RenderZealot(new ModelZealot(), 0.5F));
}
public void GenerateSurface(World var1, Random var2, int var3, int var4)
{
int var5;
int var6;
int var7;
int var8;
for(var5 = 0; var5 < 2; ++var5)
{
var6 = var3 + var2.nextInt(3) + 8;
var7 = var2.nextInt (128);
var8 = var4 + var2.nextInt(3) + 8;
new WorldGenFlowers(mod_MerkgamerSC2.MineralOre.blockID).generate(var1, var2, var6, var7, var8);
}
}
}
Now this all works good except for my flower not returning my mineral texture when destroyed my flower is called MineralOre and when destroyed and picked up it gives me the texture of a side of the stone but it still works in everything and in inventory editor it doesn't have the texture but when it spawns in the world it does have my MineralOre texture also if you have any suggestions from my code feel free to tear it apart this is a learning process. Please help... I also would greatly appreciate a tutorial on creating a mob that is similar to a creeper but detonates instantly and has bigger radius.
package net.minecraft.src;
import java.util.*;
import java.util.Random;
public class mod_MerkgamerSC2 extends BaseMod
{
public static final Item PsiBlade = new ItemPsiBlade(1505, 0).setItemName("PsiBlade");
public static final Item PsiBladeShard = new ItemPsiBladeShard(1506, 0).setItemName("PsiBladeShard");
public static final Item GasContainer = new Item(1504).setItemName("GasContainer");
public static final Item Gas = new ItemGas(1503, 0).setItemName("Gas");
public static final Item MineralShard = new ItemFood(1501, 3, false).setItemName("MineralShard");
public static final Item MineralChunk = new Item(1500).setItemName("MineralChunk");
public static final BlockFlower MineralOre = (BlockFlower) new BlockFlower(180, 0).setHardness(0.5F).setStepSound(Block.soundGlassFootstep).setBlockName("MineralOre");
public static final Item HarvesterPickaxe = new ItemPickaxeHarvester(1502, EnumToolHarvester.HARVESTER).setItemName("Harvester");
public mod_MerkgamerSC2()
{
ModLoader.RegisterEntityID(EntityZealot.class, "Zealot", ModLoader.getUniqueEntityId());
ModLoader.RegisterBlock(MineralOre);
ModLoader.AddName(PsiBladeShard, "PsiBladeEssence");
ModLoader.AddName(PsiBlade, "PsiBlade");
ModLoader.AddName(GasContainer, "GasContainer");
ModLoader.AddName(Gas, "Gas");
ModLoader.AddName(HarvesterPickaxe, "Harvester");
ModLoader.AddName(MineralOre, "MineralOre");
ModLoader.AddName(MineralShard, "MineralShard");
ModLoader.AddName(MineralChunk, "MineralChunk");
PsiBladeShard.iconIndex = ModLoader.addOverride("/gui/items.png", "/Merkgamer/PsiBladeShard.png");
PsiBlade.iconIndex = ModLoader.addOverride("/gui/items.png", "/Merkgamer/PsiBlade.png");
GasContainer.iconIndex = ModLoader.addOverride("/gui/items.png", "/Merkgamer/GasContainer.png");
Gas.iconIndex = ModLoader.addOverride("/gui/items.png", "/Merkgamer/Gas.png");
MineralOre.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/Merkgamer/Mineral.png");
MineralShard.iconIndex = ModLoader.addOverride("/gui/items.png", "/Merkgamer/MineralShard.png");
MineralChunk.iconIndex = ModLoader.addOverride("/gui/items.png", "/Merkgamer/MineralChunk.png");
HarvesterPickaxe.iconIndex = ModLoader.addOverride("/gui/items.png", "/Merkgamer/Harvester.png");
ModLoader.AddSpawn("Zealot", 3, EnumCreatureType.monster, new BiomeGenBase[] {
BiomeGenBase.iceDesert,
BiomeGenBase.taiga,
BiomeGenBase.forest,
BiomeGenBase.plains,
BiomeGenBase.rainforest,
BiomeGenBase.tundra,
});
ModLoader.AddRecipe(new ItemStack(MineralShard, 2), new Object [] {
" ", " X ", " ",
Character.valueOf('X'), MineralOre
});
ModLoader.AddRecipe(new ItemStack(MineralChunk, 1), new Object [] {
"XXX", "X X", "XXX",
Character.valueOf('X'), MineralOre
});
ModLoader.AddRecipe(new ItemStack(MineralShard, 18), new Object [] {
"XXX", "XXX", "XXX",
Character.valueOf('X'), MineralOre
});
ModLoader.AddRecipe(new ItemStack(HarvesterPickaxe, 1), new Object [] {
" M ", "GDG", " D ",
Character.valueOf('M'), MineralChunk,
Character.valueOf('G'), GasContainer,
Character.valueOf('D'), Item.ingotIron,
});
ModLoader.AddRecipe(new ItemStack(GasContainer, 1), new Object [] {
"XXX", "XXX", "XXX",
Character.valueOf('X'), Gas
});
ModLoader.AddRecipe(new ItemStack(PsiBlade, 1), new Object [] {
"PMP", "PMP", " I ",
Character.valueOf('P'), PsiBladeShard,
Character.valueOf('M'), MineralChunk,
Character.valueOf('I'), Item.ingotIron,
});
}
public String Version ()
{
return"1.7.3";
}
public void AddRenderer(Map map)
{
map.put(EntityZealot.class, new RenderZealot(new ModelZealot(), 0.5F));
}
public void GenerateSurface(World var1, Random var2, int var3, int var4)
{
int var5;
int var6;
int var7;
int var8;
for(var5 = 0; var5 < 2; ++var5)
{
var6 = var3 + var2.nextInt(3) + 8;
var7 = var2.nextInt (128);
var8 = var4 + var2.nextInt(3) + 8;
new WorldGenFlowers(mod_MerkgamerSC2.MineralOre.blockID).generate(var1, var2, var6, var7, var8);
}
}
}
Now this all works good except for my flower not returning my mineral texture when destroyed my flower is called MineralOre and when destroyed and picked up it gives me the texture of a side of the stone but it still works in everything and in inventory editor it doesn't have the texture but when it spawns in the world it does have my MineralOre texture also if you have any suggestions from my code feel free to tear it apart this is a learning process. Please help... I also would greatly appreciate a tutorial on creating a mob that is similar to a creeper but detonates instantly and has bigger radius.
Well the reason for the flower being a big grey flat block is that it doesn't have an ITEM version. Just a block for the flower won't work. (Normally it does but only if it's an OPAQUE cube, ie no transparency. Example: reeds have this; they have 2 textures, one for the item you hold one for the block itself)
You would have to change the block version to drop the item instead of the block. The item would simply place the block version when right clicked, but you can simply change the line that looks similar to this:
public static final itemName = (new ItemName(500, 0)).setIconCoord(0, 0).setItemName("itemName");
Into this:
public static final itemName = (new ItemReed(500, blockItemBecomesNameHere)).setIconCoord(0, 0).setItemName("itemName");
ItemReed simply handles the process for you, it doesn't grow, it doesn't have any other properties exept placement. (cake also uses it like this, which I found funny. :tongue.gif:)
Well the reason for the flower being a big grey flat block is that it doesn't have an ITEM version. Just a block for the flower won't work. (Normally it does but only if it's an OPAQUE cube, ie no transparency. Example: reeds have this; they have 2 textures, one for the item you hold one for the block itself)
You would have to change the block version to drop the item instead of the block. The item would simply place the block version when right clicked, but you can simply change the line that looks similar to this:
public static final itemName = (new ItemName(500, 0)).setIconCoord(0, 0).setItemName("itemName");
Into this:
public static final itemName = (new ItemReed(500, blockItemBecomesNameHere)).setIconCoord(0, 0).setItemName("itemName");
ItemReed simply handles the process for you, it doesn't grow, it doesn't have any other properties exept placement. (cake also uses it like this, which I found funny. :tongue.gif:)
thanks for helping everyone :biggrin.gif:
good job :smile.gif:
Rollback Post to RevisionRollBack
I made this map! Please check it out! It's a really awesome map that took me over a year to make! :3
Your welcome, and thanks for the epic tutorials, they helped me understand this stuff alot easier. I learn best by example which you gave alot of, so thanks! :biggrin.gif:
CowMonkey, how goes the multiple-texture tutorial? I've tried almost everything to get it to work to no avail. The closest I've gotten is this:
public int getBlockTexture(IBlockAccess iblockaccess, int i, int j, int k, int l)
{
if(l == 1)
{
return blockIndexInTexture + 1;
}
if(l == 0)
{
return blockIndexInTexture + 1;
}
int i1 = iblockaccess.getBlockMetadata(i, j, k);
if(l != i1)
{
return blockIndexInTexture;
}
return blockIndexInTexture;
}
Which works but not as you'd expect. The sides are all my custom texture, but instead of the top/bottom being the right texture it is for some reason fire ( :blink.gif: ) so i'm gonna tweak this around and see if I can't get it to work.
Never mind I figured to out. If anyone wants to know ask me.
Really… My macbook is good! I can play on normal settings… like Normal and fancy.
- Plazmotech
The error is glitched the f*ck out. I have posted the whole thing. Also, did you read the code? and the post? I dont have "item()" i have "Item"
- Plazmotech
Its just to seperate the code. I like to do that once i have big hunks of code that does one thing, then the next thng im gunna do is completly different. I learnt that from my dad. He does webprograming. :biggrin.gif: He know alot of languages but the one hes best at is PHP, and JQuary.
Although, he doesnt know java, so no help from there D:
- Plazmotech
ok first look at Madgoblins generation tutorial
now open up WorldGenT or whatever you called it and chunk this in right after your last world.setBlock
this code will allow you to place the chest and put items in it. In order to generate the chest where you want it add integers to the i, j, k like Madgoblin said in his tutorial. Make sure the values are the same for both instances of the i, j, k. Then chunk this method in after the generate method.
This method will tell the chest what items to have inside it. This code is the one used in dungeons so you can mess around with it to get the items you want in your chest.
I hope it works for you
yes it did
Odd, I was sure I did it correctly. Still if I didn't you could try this:
Keep in mind the other might be right but your code generation is too complex or uses variables or something that could interfere or conflict with this. I can't be sure since I don't have that code in front of me.
http://www.minecraftforum.net/topic/745204-wip-ww3-craft/page__p__9715611__fromsearch__1#entry9715611
Ya I think my code is too complex but the first one works fine so I'm happy. :smile.gif:
I will try the code with a simpler code.
I just tried your code with a simpler one block generation and minecraft still crashed.
Can I see your generation code for the simple setup?
Well the reason for the flower being a big grey flat block is that it doesn't have an ITEM version. Just a block for the flower won't work. (Normally it does but only if it's an OPAQUE cube, ie no transparency. Example: reeds have this; they have 2 textures, one for the item you hold one for the block itself)
You would have to change the block version to drop the item instead of the block. The item would simply place the block version when right clicked, but you can simply change the line that looks similar to this:
Into this:
ItemReed simply handles the process for you, it doesn't grow, it doesn't have any other properties exept placement. (cake also uses it like this, which I found funny. :tongue.gif:)
thanks for helping everyone :biggrin.gif:
good job :smile.gif:
I made this map! Please check it out! It's a really awesome map that took me over a year to make! :3
Your welcome, and thanks for the epic tutorials, they helped me understand this stuff alot easier. I learn best by example which you gave alot of, so thanks! :biggrin.gif:
Which works but not as you'd expect. The sides are all my custom texture, but instead of the top/bottom being the right texture it is for some reason fire ( :blink.gif: ) so i'm gonna tweak this around and see if I can't get it to work.