in this code, Block.fence.blockID makes you achieve the achievement if you get the Block.fence in the game.
Then, how does this code changes when I want to achieve an achievement by getting an item that I modded?
that's easy
instead of Block.fence.blockID
put mod_***.(Ur item/block).shiftedIndex/blockID
.shiftedIndex is for Items you made, .blockID is for the block's you made
I found out what the 0 in the potion effect food does, it is the degree of the effect, like when you have a potion and you combine it with glowstone, it then has a stronger effect, and I think (from some testing) that when you make the 0 say, a 1, in will increase the speed of the effect.
Um, I can't get my oatmeal to work, no errors but it won't give me the bowl back
my code:
package net.minecraft.src;
public class ItemoatMeal extends Item
{
public ItemoatMeal(int i, int j)
{
super(i);
maxStackSize = 1;
}
public ItemStack onFoodEaten(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
super.onFoodEaten(par1ItemStack, par2World, par3EntityPlayer);
return new ItemStack(Item.bowlEmpty);
}
}
Um, I can't get my oatmeal to work, no errors but it won't give me the bowl back
my code:
package net.minecraft.src;
public class ItemoatMeal extends Item
{
public ItemoatMeal(int i, int j)
{
super(i);
maxStackSize = 1;
}
public ItemStack onFoodEaten(ItemStack itemstack, World world, EntityPlayer
entityplayer)
{
super.onFoodEaten(itemstack, world, entityplayer);
return new
ItemStack(Item.bowlEmpty);
}
}
Could you do a tutorial on how to make NPC's move to a certain coords. More preferable if I could record movements and the NPC moves based on how I moved in the recording.
That's quite advanced AI. I'm currently learning how to do good AI, so I won't be able to make a tutorial on it for a while.
Rollback Post to RevisionRollBack
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
actually, I updated it so that it looked like the one in the soup, and it works as food. I take it, I eat it, but it gives me nothing, also the max stack thing isn't working (I can stack it to 64) and that was my ItemoatMeal.java
Hey TechGuy, its ok
So,can i help you for the tut of the disc ?
I Have Found one but i make something wrong...if i fix i can pass to you the file ?
You should be like this: OMFG THIS KID IS TOO F**KING ANNOING!!!!
actually, I updated it so that it looked like the one in the soup, and it works as food. I take it, I eat it, but it gives me nothing, also the max stack thing isn't working (I can stack it to 64) and that was my ItemoatMeal.java
Make sure you are calling the class correctly in its public static final line.
public static final Item oatmeal = new Itemoatmeal(ID)...
Hey TechGuy, its ok
So,can i help you for the tut of the disc ?
I Have Found one but i make something wrong...if i fix i can pass to you the file ?
You should be like this: OMFG THIS KID IS TOO F**KING ANNOING!!!!
I think I know how to do it. I just haven't really got the time at the moment to make a tutorial. It normally takes me about an hour to make one simple tutorial.
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
sorry I ust copy/pasted it.. but you didnt answer, and I thought you didnt see it over all the comments.. soo here it is Oh, and.. Can you show us how to make an item that spawns a mob? But.. (Heres the catch), when you rite click with the item, It opens a GUI. It could have, Spawn "Custom Monster" Spawn "Custom Monster" Or "No thanks!" But in order to spawn some thing, you need to have the XP for it. . WHat do you think? Could you make it?
sorry I ust copy/pasted it.. but you didnt answer, and I thought you didnt see it over all the comments.. soo here it is Oh, and.. Can you show us how to make an item that spawns a mob? But.. (Heres the catch), when you rite click with the item, It opens a GUI. It could have, Spawn "Custom Monster" Spawn "Custom Monster" Or "No thanks!" But in order to spawn some thing, you need to have the XP for it. . WHat do you think? Could you make it?
I'm working on making a spawner with a gui at the moment for the mod I'm working on. When I accomplish it and get it working properly, then I'll make a tutorial. I'll make a simple mob spawner item tutorial though if you want it.
Rollback Post to RevisionRollBack
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
I'm working on making a spawner with a gui at the moment for the mod I'm working on. When I accomplish it and get it working properly, then I'll make a tutorial. I'll make a simple mob spawner item tutorial though if you want it.
Would that be something like the spawn eggs used in creative mode? There's an old mob mod that was abandoned in 1.8.1 that I'm trying to revive (original creator released his source code and I plan to give credit) and I'd like to add a spawn egg for it.
Rollback Post to RevisionRollBack
Yes, I like bats. No, I'm not emo. And I don't like vampires (except Nikola Tesla). I just like bats.
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
The problem is that this part "new ItemObsidianTools(600).setItemName" is red underlined and idk how to fix it...
I think that the problem is that you assigned an ID that doesn't exist, as I don't think that the IDs go up past 300, much less 600
@ Techguy, I got my oatmeal to work, so thanks
I'm working on making a spawner with a gui at the moment for the mod I'm working on. When I accomplish it and get it working properly, then I'll make a tutorial. I'll make a simple mob spawner item tutorial though if you want it.
Yes please! Can you tell me how to make a custom mob spawner?
Also, would this work if I just copy/pasted it in the Entity(My mob)? :
protected void playStepSound(int par1, int par2, int par3, int par4)
{
worldObj.playSoundAtEntity(this, "mob.irongolem.walk", 1.0F, 1.0F);
}
Also, I hope I see how to make a custom item spawn a mob tut (: ).
Thanks!
Wth is wrong with you? Atleast he's making an effort. Sheesh, I'd like to see you do better
its just that he'd help me a while ago... i messaged him on why he isnt responding... he is just commenting here on the bloody thread instead of even reading the message, he promised something and he still didnt do that. Thats why im pissed skinmaker >_>
Damn erros .... I used diffrent tut but the guy doesnt respond.. pls help also u got skype? anyway heres my code..
The problem is that this part "new ItemObsidianTools(600).setItemName" is red underlined and idk how to fix it...
public static final Item obsidian_ingot = new ItemObsidianTools(600).setItemName("Obsidian Ingot");
package net.minecraft.src;
public class mod_obsidianingot extends BaseMod
{
public static final Item obsidian_ingot = new ItemObsidianTools(600).setItemName("Obsidian Ingot");
public mod_obsidianingot()
{
obsidian_ingot.iconIndex = ModLoader.addOverride("/gui/items.png", "/gui/Dark Messiahs Mods/ObsidianTools/ObsidianIngot.png");
ModLoader.addName(obsidian_ingot ,"Obsidian Ingot");
ModLoader.addRecipe(new ItemStack(obsidian_ingot, 2), new Object[] {
"XX" ,"XX", Character.valueOf('X'), Block.obsidian});
ModLoader.addRecipe(new ItemStack(Block.obsidian, 6), new Object[] {
"XX", "XX", Character.valueOf('X'), obsidian_ingot});
}
public String getVersion()
{
return "1.2.3";
}
public void load(){}
}
Heres problem with my tools aswel pls help!
just add me to skype : kasparello1 so we can talk
package net.minecraft.src;
public class ObsidianItemPickaxe extends ItemObsidianTools
{
private static Block blocksEffectiveAgainst[];
protected ObsidianItemPickaxe(int par1, EnumToolMaterial par2EnumToolMaterial)
{
super(par1, 2, par2EnumToolMaterial, blocksEffectiveAgainst);
}
/**
* Returns if the item (tool) can harvest results from the block type.
*/
public boolean canHarvestBlock(Block par1Block)
{
if (par1Block == Block.obsidian)
{
return toolMaterial.getHarvestLevel() == 5;
}
if (par1Block == Block.blockDiamond || par1Block == Block.oreDiamond)
{
return toolMaterial.getHarvestLevel() >= 4;
}
if (par1Block == Block.blockGold || par1Block == Block.oreGold)
{
return toolMaterial.getHarvestLevel() >= 4;
}
if (par1Block == Block.blockSteel || par1Block == Block.oreIron)
{
return toolMaterial.getHarvestLevel() >= 3;
}
if (par1Block == Block.blockLapis || par1Block == Block.oreLapis)
{
return toolMaterial.getHarvestLevel() >= 4;
}
if (par1Block == Block.oreRedstone || par1Block == Block.oreRedstoneGlowing)
{
return toolMaterial.getHarvestLevel() >= 4;
}
if (par1Block.blockMaterial == Material.rock)
{
return true;
}
return block.blockMaterial == Material.iron;
}
/**
* Returns the strength of the stack against a given block. 1.0F base, (Quality+1)*2 if correct blocktype, 1.5F if
* sword
*/
public float getStrVsBlock(ItemStack par1ItemStack, Block par2Block)
{
if (par2Block != null && (par2Block.blockMaterial == Material.iron || par2Block.blockMaterial == Material.rock))
{
return efficiencyOnProperMaterial;
}
else
{
return super.getStrVsBlock(par1ItemStack, par2Block);
}
}
static
{
blocksEffectiveAgainst = (new Block[] {
Block.cobblestone, Block.stairDouble, Block.stairSingle, Block.stone, Block.sandStone, Block.cobblestoneMossy, Block.oreIron, Block.blockSteel, Block.oreCoal, Block.blockGold,
Block.oreGold, Block.oreDiamond, Block.blockDiamond, Block.ice, Block.netherrack, Block.oreLapis, Block.blockLapis, Block.oreRedstone, Block.oreRedstoneGlowing, Block.rail,
Block.railDetector, Block.railPowered, Block.obsidian,
});
}
}
Just make it a "new Item(600).setItemName...".Chances are that your tool class has more ints and the like in its constructor, and you wouldn't have defined them inside the ID brackets. You shouldn't have it extending the tool class anyway.
Whatever i do i canot get my ore i made spawning... is this because mcp updated or is there something wrong in my script? i dont get errors in the compiler, it just doesnt spawn. here is my code:
package net.minecraft.src;
import java.util.Map;
import java.util.Random;
public class mod_Silver extends BaseMod
{
public static final Block Silver = new BlockSilver(160, 0).setBlockName("Silver").setHardness(3F).setResistance(4F).setLightValue(1F);
public void load()
{
Silver.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/Mod/silver.png");
ModLoader.registerBlock(Silver);
ModLoader.addName(Silver, "Silver Ore");
ModLoader.addRecipe(new ItemStack(Silver, 1), new Object [] {"#", Character.valueOf('#'), Block.dirt});
}
public String getVersion()
{
return "1.1";
}
public void GenerateSurface(World world, Random rand, int chunkX, int chunkZ)
{
for(int i = 0; i < 20; i++)
{
int randPosX = chunkX + rand.nextInt(16);
int randPosY = rand.nextInt(64);
int randPosZ = chunkZ + rand.nextInt(16);
(new WorldGenMinable(mod_Silver.Silver.blockID, 12)).generate(world, rand, randPosX, randPosY, randPosZ);
}
}
}
and my block...
package net.minecraft.src;
import java.util.Random;
public class BlockSilver extends Block
{
public BlockSilver(int i, int j)
{
super(i, j, Material.rock);
}
public int idDropped(int i, Random random, int j)
{
return mod_Silver.Silver.blockID;
}
public int quantityDropped(Random random)
{
return 1;
}
}
I love the way you have time to respond to everyone... only not to me and my message... this is something we need very quick Tech... seriously...
I haven't received a message from you in ages. Just because you need something very quick, doesn't mean I have the time to make a tutorial for it. It takes me over an hour to make a tutorial, and I don't have that sort of time at the moment. I only have a few minutes here and there.
I could be making a crop tutorial, but complaining that you need it really quick will only delay my posting of it... seriously...
If you were that desperate for it, you would have figured it out by yourself. I'm not here to hold everyone's hand. I'm here to give them a start.
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
One Problem, though.
For my plant (which I got from another tutorial), it tells me that the setTickOnLoad(true); boolen function isn't found, and it wants me to add one. What do I do? Here's my code, along with the mod file:
//BlockTomato.java
package net.minecraft.src;
import java.util.Random;
public class BlockTomato extends Block
{
public int topID;
public int sideBottomID;
protected BlockTomato(int i, int j, int m, int n)
{
super(i, Material.plants);
blockIndexInTexture = j;
float f = 0.375F;
setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, 1.0F, 0.5F + f);
setTickOnLoad(true);
topID = m;
sideBottomID = n;
}
public void updateTick(World world, int i, int j, int k, Random random)
{
if(world.isAirBlock(i, j + 1, k))
{
int l;
for(l = 1; world.getBlockId(i, j - l, k) == blockID; l++) { }
if(l < 3)
{
int i1 = world.getBlockMetadata(i, j, k);
if(i1 == 15)
{
world.setBlockWithNotify(i, j + 1, k, blockID);
world.setBlockMetadataWithNotify(i, j, k, 0);
} else
{
world.setBlockMetadataWithNotify(i, j, k, i1 + 1);
}
}
}
}
public boolean canPlaceBlockAt(World world, int i, int j, int k)
{
int l = world.getBlockId(i, j - 1, k);
if(l == blockID)
{
return true;
}
return l == Block.grass.blockID || l == Block.dirt.blockID || l == Block.tilledField.blockID || l == Block.sand.blockID;
}
public void onNeighborBlockChange(World world, int i, int j, int k, int l)
{
checkBlockCoordValid(world, i, j, k);
}
protected final void checkBlockCoordValid(World world, int i, int j, int k)
{
if(!canBlockStay(world, i, j, k))
{
dropBlockAsItem(world, i, j, k, world.getBlockMetadata(i, j, k), 0);
world.setBlockWithNotify(i, j, k, 0);
}
}
public boolean canBlockStay(World world, int i, int j, int k)
{
return canPlaceBlockAt(world, i, j, k);
}
public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int i, int j, int k)
{
return null;
}
public boolean isOpaqueCube()
{
return false;
}
public int idDropped(int i, Random random, int j)
{
return mod_Tomato.iTomato.shiftedIndex;
}
public int quantityDropped(Random random)
{
return 4;
}
public int getBlockTextureFromSide(int i)
{
if (i == 1)
{
return mod_Tomato.topID;
}
else
{
return mod_Tomato.sideBottomID;
}
}
}
//mod_Tomato.java
package net.minecraft.src;
import java.util.Random;
public class mod_Tomato extends BaseMod
{
public static final Block bTomato = new BlockTomato(127,0,0,0).setHardness(0.5F).setResistance(1F).setBlockName("tomatoBlock");
public static final Item iTomato = new ItemFood(397, 4, false).setItemName("tomatoFood");
public static int topID;
public static int sideBottomID;
public mod_Tomato()
{
ModLoader.registerBlock(bTomato);
that's easy
instead of Block.fence.blockID
put mod_***.(Ur item/block).shiftedIndex/blockID
.shiftedIndex is for Items you made, .blockID is for the block's you made
-
View User Profile
-
View Posts
-
Send Message
Curse Premium-
View User Profile
-
View Posts
-
Send Message
Curse Premiummy code:
package net.minecraft.src; public class ItemoatMeal extends Item { public ItemoatMeal(int i, int j) { super(i); maxStackSize = 1; } public ItemStack onFoodEaten(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { super.onFoodEaten(par1ItemStack, par2World, par3EntityPlayer); return new ItemStack(Item.bowlEmpty); } }Are you calling that class correctly?
That's quite advanced AI. I'm currently learning how to do good AI, so I won't be able to make a tutorial on it for a while.
together they are powerful beyond imagination."
-
View User Profile
-
View Posts
-
Send Message
Curse Premiumactually, I updated it so that it looked like the one in the soup, and it works as food. I take it, I eat it, but it gives me nothing, also the max stack thing isn't working (I can stack it to 64) and that was my ItemoatMeal.java
So,can i help you for the tut of the disc ?
I Have Found one but i make something wrong...if i fix i can pass to you the file ?
You should be like this: OMFG THIS KID IS TOO F**KING ANNOING!!!!
Make sure you are calling the class correctly in its public static final line.
I think I know how to do it. I just haven't really got the time at the moment to make a tutorial. It normally takes me about an hour to make one simple tutorial.
together they are powerful beyond imagination."
Oh, and.. Can you show us how to make an item that spawns a mob?
But.. (Heres the catch), when you rite click with the item, It opens a GUI.
It could have, Spawn "Custom Monster" Spawn "Custom Monster"
Or "No thanks!"
But in order to spawn some thing, you need to have the XP for it.
WHat do you think? Could you make it?
I'm working on making a spawner with a gui at the moment for the mod I'm working on. When I accomplish it and get it working properly, then I'll make a tutorial. I'll make a simple mob spawner item tutorial though if you want it.
together they are powerful beyond imagination."
Would that be something like the spawn eggs used in creative mode? There's an old mob mod that was abandoned in 1.8.1 that I'm trying to revive (original creator released his source code and I plan to give credit) and I'd like to add a spawn egg for it.
Yes.
together they are powerful beyond imagination."
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumI think that the problem is that you assigned an ID that doesn't exist, as I don't think that the IDs go up past 300, much less 600
@ Techguy, I got my oatmeal to work, so thanks
Yes please! Can you tell me how to make a custom mob spawner?
Also, would this work if I just copy/pasted it in the Entity(My mob)? :
protected void playStepSound(int par1, int par2, int par3, int par4) { worldObj.playSoundAtEntity(this, "mob.irongolem.walk", 1.0F, 1.0F); }Also, I hope I see how to make a custom item spawn a mob tut (: ).
Thanks!
http://www.minecraftsao.org/
Check it out!
Wth is wrong with you? Atleast he's making an effort. Sheesh, I'd like to see you do better
its just that he'd help me a while ago... i messaged him on why he isnt responding... he is just commenting here on the bloody thread instead of even reading the message, he promised something and he still didnt do that. Thats why im pissed skinmaker >_>
http://www.minecraftsao.org/
Check it out!
Just make it a "new Item(600).setItemName...".Chances are that your tool class has more ints and the like in its constructor, and you wouldn't have defined them inside the ID brackets. You shouldn't have it extending the tool class anyway.
GenerateSurface is now generateSurface
I haven't received a message from you in ages. Just because you need something very quick, doesn't mean I have the time to make a tutorial for it. It takes me over an hour to make a tutorial, and I don't have that sort of time at the moment. I only have a few minutes here and there.
I could be making a crop tutorial, but complaining that you need it really quick will only delay my posting of it... seriously...
If you were that desperate for it, you would have figured it out by yourself. I'm not here to hold everyone's hand. I'm here to give them a start.
together they are powerful beyond imagination."
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumOne Problem, though.
For my plant (which I got from another tutorial), it tells me that the setTickOnLoad(true); boolen function isn't found, and it wants me to add one. What do I do? Here's my code, along with the mod file:
//BlockTomato.java
package net.minecraft.src;
import java.util.Random;
public class BlockTomato extends Block
{
public int topID;
public int sideBottomID;
protected BlockTomato(int i, int j, int m, int n)
{
super(i, Material.plants);
blockIndexInTexture = j;
float f = 0.375F;
setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, 1.0F, 0.5F + f);
setTickOnLoad(true);
topID = m;
sideBottomID = n;
}
public void updateTick(World world, int i, int j, int k, Random random)
{
if(world.isAirBlock(i, j + 1, k))
{
int l;
for(l = 1; world.getBlockId(i, j - l, k) == blockID; l++) { }
if(l < 3)
{
int i1 = world.getBlockMetadata(i, j, k);
if(i1 == 15)
{
world.setBlockWithNotify(i, j + 1, k, blockID);
world.setBlockMetadataWithNotify(i, j, k, 0);
} else
{
world.setBlockMetadataWithNotify(i, j, k, i1 + 1);
}
}
}
}
public boolean canPlaceBlockAt(World world, int i, int j, int k)
{
int l = world.getBlockId(i, j - 1, k);
if(l == blockID)
{
return true;
}
return l == Block.grass.blockID || l == Block.dirt.blockID || l == Block.tilledField.blockID || l == Block.sand.blockID;
}
public void onNeighborBlockChange(World world, int i, int j, int k, int l)
{
checkBlockCoordValid(world, i, j, k);
}
protected final void checkBlockCoordValid(World world, int i, int j, int k)
{
if(!canBlockStay(world, i, j, k))
{
dropBlockAsItem(world, i, j, k, world.getBlockMetadata(i, j, k), 0);
world.setBlockWithNotify(i, j, k, 0);
}
}
public boolean canBlockStay(World world, int i, int j, int k)
{
return canPlaceBlockAt(world, i, j, k);
}
public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int i, int j, int k)
{
return null;
}
public boolean isOpaqueCube()
{
return false;
}
public int idDropped(int i, Random random, int j)
{
return mod_Tomato.iTomato.shiftedIndex;
}
public int quantityDropped(Random random)
{
return 4;
}
public int getBlockTextureFromSide(int i)
{
if (i == 1)
{
return mod_Tomato.topID;
}
else
{
return mod_Tomato.sideBottomID;
}
}
}
//mod_Tomato.java
package net.minecraft.src;
import java.util.Random;
public class mod_Tomato extends BaseMod
{
public static final Block bTomato = new BlockTomato(127,0,0,0).setHardness(0.5F).setResistance(1F).setBlockName("tomatoBlock");
public static final Item iTomato = new ItemFood(397, 4, false).setItemName("tomatoFood");
public static int topID;
public static int sideBottomID;
public mod_Tomato()
{
ModLoader.registerBlock(bTomato);
ModLoader.addName(bTomato, "Tomato");
ModLoader.addName(iTomato, "Tomato");
ModLoader.addOverride("/terrain.png","/bTomatoT.png",topID);
ModLoader.addOverride("/terrain.png","/bTomatoS.png",sideBottomID);
iTomato.iconIndex = ModLoader.addOverride("/gui/items.png","/tomato.png");
ModLoader.addRecipe(new ItemStack(mod_Tomato.bTomato, 1), new Object []{
"**","**", Character.valueOf('*'), mod_Tomato.iTomato
});
ModLoader.addRecipe(new ItemStack(mod_Tomato.iTomato, 4), new Object []{
"*", Character.valueOf('*'), mod_Tomato.bTomato
});
}
static
{
topID = ModLoader.getUniqueSpriteIndex("/terrain.png");
sideBottomID = ModLoader.getUniqueSpriteIndex("/terrain.png");
}
public void GenerateSurface(World world, Random random, int i, int j)
{
if(random.nextInt(20) == 0)
{
for(int k = 0; k < 16; k++)
{
for(int l = 0; l < 16; l++)
{
int i1 = random.nextInt(200);
if(world.getBlockId(i + l, i1, j + k) != Block.grass.blockID || !world.isAirBlock(i + l, i1 + 1, j + k))
{
continue;
}
int j1 = random.nextInt(2);
if(j1 == 0)
{
world.setBlock(i + l, i1 + 1, j + k, bTomato.blockID);
}
if(j1 == 1)
{
world.setBlock(i + l, i1 + 1, j + k, bTomato.blockID);
world.setBlock(i + l, i1 + 2, j + k, bTomato.blockID);
}
if(j1 == 2)
{
world.setBlock(i + l, i1 + 1, j + k, bTomato.blockID);
world.setBlock(i + l, i1 + 2, j + k, bTomato.blockID);
world.setBlock(i + l, i1 + 3, j + k, bTomato.blockID);
}
if(j1 == 3)
{
world.setBlock(i + l, i1 + 1, j + k, bTomato.blockID);
world.setBlock(i + l, i1 + 2, j + k, bTomato.blockID);
world.setBlock(i + l, i1 + 3, j + k, bTomato.blockID);
world.setBlock(i + l, i1 + 4, j + k, bTomato.blockID);
}
}
}
}
}
public void load()
{
}
public String getVersion()
{
return "ERROR FOR 1.2.3";
}
}
Thanks!
Edit: I figured out how to do it by looking a the biped code already there