Hello, I made a ShineStone mod, which is stone that has a light value of 1.5, which is crafted by stone surrounding glowstone. The recipe works, the block works, but I haven't figured out how to make the name ShineStone appear in minecraft. help?
Btw, thx for the tutorials on modding with modloader, much more easier.
src\minecraft\net\minecraft\src\mod_Ninja.java:12: error: illegal start of type
ModLoader.addRecipe(new ItemStack(sword, 1), new Object [] {" #" " #" "% " Char
acter.valueOf('#'), Item.ingotIron, Character.valueOf('%'), Item.stick});
^
src\minecraft\net\minecraft\src\mod_Ninja.java:16: error: class, interface, or e
num expected
public String getVersion()
^
src\minecraft\net\minecraft\src\mod_Ninja.java:19: error: class, interface, or e
num expected
}
^
Here is the recipe I am shooting for
Most of the errors are from the recipe but when I change to what it wants, more errors and it's not what your template looks like. a lot are also from the mod_Ninja file.
Here's my code.
mod_Ninja
package net.minecraft.src;
public class mod_Ninja extends BaseMod
{
public static final Item sword = new ItemKatana(2003, EnumToolMaterialIron.IRON).setItemName("Katana");
public void load()
{
sword.iconIndex = ModLoader.addOverride("/gui/items.png", "/mods/Katana.png");
package net.minecraft.src;
public class ItemKatana extends Item
{
private int weaponDamage;
private final EnumToolMaterialIron toolMaterial;
public ItemKatana(int par1, EnumToolMaterialIron par2EnumToolMaterialIron)
{
super(par1);
toolMaterial = par2EnumToolMaterialIron;
maxStackSize = 1;
setMaxDamage(par2EnumToolMaterialIron.getMaxUses());
weaponDamage = 6 + par2EnumToolMaterialIron.getDamageVsEntity();
}
/**
* 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)
{
return par2Block.blockID != Block.web.blockID ? 1.5F : 15F;
}
/**
* Current implementations of this method in foal classes do not use the entry argument beside ev. They just raise
* the damage on the stack.
*/
public boolean hitEntity(ItemStack par1ItemStack, EntityLiving par2EntityLiving, EntityLiving par3EntityLiving)
{
par1ItemStack.damageItem(1, par3EntityLiving);
return true;
}
public boolean onBlockDestroyed(ItemStack par1ItemStack, int par2, int par3, int par4, int par5, EntityLiving par6EntityLiving)
{
par1ItemStack.damageItem(2, par6EntityLiving);
return true;
}
/**
* Returns the damage against a given entity.
*/
public int getDamageVsEntity(Entity par1Entity)
{
return weaponDamage;
}
/**
* Returns True is the item is renderer in full 3D when hold.
*/
public boolean isFull3D()
{
return true;
}
/**
* returns the action that specifies what animation to play when the items is being used
*/
public EnumAction getItemUseAction(ItemStack par1ItemStack)
{
return EnumAction.block;
}
/**
* How long it takes to use or consume an item
*/
public int getMaxItemUseDuration(ItemStack par1ItemStack)
{
return 600;
}
/**
* Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer
*/
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
par3EntityPlayer.setItemInUse(par1ItemStack, getMaxItemUseDuration(par1ItemStack));
return par1ItemStack;
}
/**
* Returns if the item (tool) can harvest results from the block type.
*/
public boolean canHarvestBlock(Block par1Block)
{
return par1Block.blockID == Block.web.blockID;
}
/**
* Return the enchantability factor of the item, most of the time is based on material.
*/
public int getItemEnchantability()
{
return toolMaterial.getEnchantability();
}
public String func_77825_f()
{
return this.toolMaterial.toString();
}
}
What do I put if I want the ToolMaterial to be iron? Thanks in advance.
package net.minecraft.src;
public class mod_block extends BaseMod
{
public static final Block crate = new BlockCrate(160,
0,Material.wood).setBlockname(Crate).sethardnees(5f).setresistance(5f).setCreativeTab(CreativeTabs.tabBlock);
public void load()
{
crate.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/crate.png");
ModLoader.registerblock(crate);
ModLoader.addname(crate, "Crate");
}
public String getVersion()
{
return "1.3.1";
}
}
First, check up on your coding itself: the block variable crate needs to be an instance of Block. Plus it's full of errors. Example code:
public static final Block crate = new Block(160,
0, Material.wood).setBlockName("crate").setHardness(5F).setResistance(5F).setCreativeTab(CreativeTabs.tabBlock);
Next, check your method names, like ModLoader.addName <- you didn't capitalize the 'N' in addName; ModLoader.registerBlock; <- you didn't capitalize the B in registerBlock.
Hope this helps!
Hello, I made a ShineStone mod, which is stone that has a light value of 1.5, which is crafted by stone surrounding glowstone. The recipe works, the block works, but I haven't figured out how to make the name ShineStone appear in minecraft. help?
Btw, thx for the tutorials on modding with modloader, much more easier.
Add this line of code in the load() method:
ModLoader.addName(blockNameHere, "ShineStone");
Where "blockNameHere" is the name of the variable itself.
First, check up on your coding itself: the block variable crate needs to be an instance of Block. Plus it's full of errors. Example code:
public static final Block crate = new Block(160,
0, Material.wood).setBlockName("crate").setHardness(5F).setResistance(5F).setCreativeTab(CreativeTabs.tabBlock);
Next, check your method names, like ModLoader.addName <- you didn't capitalize the 'N' in addName; ModLoader.registerBlock; <- you didn't capitalize the B in registerBlock.
Hope this helps!
thanks i changed it and now i have one error
src\minecraft\net\minecraft\src\blockcrate.java:11: error: ';' expected return mod_block.crate.160;
code
package net.minecraft.src;
public class mod_block extends BaseMod
{
public static final Block crate = new BlockCrate(160,
0,Material.wood).setBlockname("Crate").sethardnees(5f).setresistance(5f).setCreativeTab(CreativeTabs.tabBlock);
public void load()
{
crate.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/crate.png");
ModLoader.registerBlock(crate);
ModLoader.addName(crate, "Crate");
}
public String getVersion()
{
return "1.3.1";
}
}
and my blockCrate class
package net.minecraft.src;
import java.util.Random;
public class crate extends Block
{
public crate(int i, int j)
{
super(i, j, Material.wood);
}
public int idDropped(int i, Random random, int j)
{
return mod_Block.crate.160;
}
public int quantityDropped(Random random)
{
return 1;
}
}
src\minecraft\net\minecraft\src\mod_Ninja.java:12: error: illegal start of type
ModLoader.addRecipe(new ItemStack(sword, 1), new Object [] {" #" " #" "% " Char
acter.valueOf('#'), Item.ingotIron, Character.valueOf('%'), Item.stick});
^
src\minecraft\net\minecraft\src\mod_Ninja.java:16: error: class, interface, or e
num expected
public String getVersion()
^
src\minecraft\net\minecraft\src\mod_Ninja.java:19: error: class, interface, or e
num expected
}
^
Here is the recipe I am shooting for
Most of the errors are from the recipe but when I change to what it wants, more errors and it's not what your template looks like. a lot are also from the mod_Ninja file.
Here's my code.
mod_Ninja
package net.minecraft.src;
public class mod_Ninja extends BaseMod
{
public static final Item sword = new ItemKatana(2003, EnumToolMaterialIron.IRON).setItemName("Katana");
public void load()
{
sword.iconIndex = ModLoader.addOverride("/gui/items.png", "/mods/Katana.png");
package net.minecraft.src;
public class ItemKatana extends Item
{
private int weaponDamage;
private final EnumToolMaterialIron toolMaterial;
public ItemKatana(int par1, EnumToolMaterialIron par2EnumToolMaterialIron)
{
super(par1);
toolMaterial = par2EnumToolMaterialIron;
maxStackSize = 1;
setMaxDamage(par2EnumToolMaterialIron.getMaxUses());
weaponDamage = 6 + par2EnumToolMaterialIron.getDamageVsEntity();
}
/**
* 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)
{
return par2Block.blockID != Block.web.blockID ? 1.5F : 15F;
}
/**
* Current implementations of this method in foal classes do not use the entry argument beside ev. They just raise
* the damage on the stack.
*/
public boolean hitEntity(ItemStack par1ItemStack, EntityLiving par2EntityLiving, EntityLiving par3EntityLiving)
{
par1ItemStack.damageItem(1, par3EntityLiving);
return true;
}
public boolean onBlockDestroyed(ItemStack par1ItemStack, int par2, int par3, int par4, int par5, EntityLiving par6EntityLiving)
{
par1ItemStack.damageItem(2, par6EntityLiving);
return true;
}
/**
* Returns the damage against a given entity.
*/
public int getDamageVsEntity(Entity par1Entity)
{
return weaponDamage;
}
/**
* Returns True is the item is renderer in full 3D when hold.
*/
public boolean isFull3D()
{
return true;
}
/**
* returns the action that specifies what animation to play when the items is being used
*/
public EnumAction getItemUseAction(ItemStack par1ItemStack)
{
return EnumAction.block;
}
/**
* How long it takes to use or consume an item
*/
public int getMaxItemUseDuration(ItemStack par1ItemStack)
{
return 600;
}
/**
* Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer
*/
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
par3EntityPlayer.setItemInUse(par1ItemStack, getMaxItemUseDuration(par1ItemStack));
return par1ItemStack;
}
/**
* Returns if the item (tool) can harvest results from the block type.
*/
public boolean canHarvestBlock(Block par1Block)
{
return par1Block.blockID == Block.web.blockID;
}
/**
* Return the enchantability factor of the item, most of the time is based on material.
*/
public int getItemEnchantability()
{
return toolMaterial.getEnchantability();
}
public String func_77825_f()
{
return this.toolMaterial.toString();
}
}
What do I put if I want the ToolMaterial to be iron? Thanks in advance.
thanks i changed it and now i have one error
src\minecraft\net\minecraft\src\blockcrate.java:11: error: ';' expected return mod_block.crate.160;
code
package net.minecraft.src;
public class mod_block extends BaseMod
{
public static final Block crate = new BlockCrate(160,
0,Material.wood).setBlockname("Crate").sethardnees(5f).setresistance(5f).setCreativeTab(CreativeTabs.tabBlock);
public void load()
{
crate.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/crate.png");
ModLoader.registerBlock(crate);
ModLoader.addName(crate, "Crate");
}
public String getVersion()
{
return "1.3.1";
}
}
and my blockCrate class
package net.minecraft.src;
import java.util.Random;
public class crate extends Block
{
public crate(int i, int j)
{
super(i, j, Material.wood);
}
public int idDropped(int i, Random random, int j)
{
return mod_Block.crate.160;
}
public int quantityDropped(Random random)
{
return 1;
}
}
Just have to warn you, be very careful with your code. I tried cleaning it up a bit, you had 2 different names for your BlockCrate class, a few misspellings, and some illegal arguments. I don't generally like to fix code entirely for people, but maybe you can see what's going on when it's working:
package net.minecraft.src;
public class mod_Block extends BaseMod
{
public static final Block crate = new BlockCrate(160,
0).setBlockName("Crate").setHardness(5F).setResistance(5F).setCreativeTab(CreativeTabs.tabBlock);
public void load()
{
crate.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/crate.png");
ModLoader.registerBlock(crate);
ModLoader.addName(crate, "Crate");
}
public String getVersion()
{
return "1.3.1";
}
}
And this for your BlockCrate class:
package net.minecraft.src;
import java.util.Random;
public class BlockCrate extends Block
{
public crate(int i, int j)
{
super(i, j, Material.wood);
}
public int idDropped(int i, Random random, int j)
{
return mod_Block.crate.blockID;
}
public int quantityDropped(Random random)
{
return 1;
}
}
Just have to warn you, be very careful with your code. I tried cleaning it up a bit, you had 2 different names for your BlockCrate class, a few misspellings, and some illegal arguments. I don't generally like to fix code entirely for people, but maybe you can see what's going on when it's working:
package net.minecraft.src;
public class mod_Block extends BaseMod
{
public static final Block crate = new BlockCrate(160,
0).setBlockName("Crate").setHardness(5F).setResistance(5F).setCreativeTab(CreativeTabs.tabBlock);
public void load()
{
crate.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/crate.png");
ModLoader.registerBlock(crate);
ModLoader.addName(crate, "Crate");
}
public String getVersion()
{
return "1.3.1";
}
}
And this for your BlockCrate class:
package net.minecraft.src;
import java.util.Random;
public class BlockCrate extends Block
{
public crate(int i, int j)
{
super(i, j, Material.wood);
}
public int idDropped(int i, Random random, int j)
{
return mod_Block.crate.blockID;
}
public int quantityDropped(Random random)
{
return 1;
}
}
i did that and now i have a new error
src\minecraft\net\minecraft\src\BlockCrate.java:5: error: invalid method declaration; return required
public type required
public crate(int i, int j)
i did that and now i have a new error
src\minecraft\net\minecraft\src\BlockCrate.java:5: error: invalid method declaration; return required
public type required
public crate(int i, int j)
Techguy, I am pulling this from a while back, there are currently two versions, one that someone fixed up for me, and the one I did. Now, not only am I trying to add in redstone properties for them, but I am also trying to figure out how to edit the redstone torches, to where they would last two minutes/120 seconds. Like a timer. Once they exceed the time, they brun out for good and you can have burnt out redstone torches. They're supposed to be like batteries in my mod.
Right now, that's pretty much all I need to know, is how to give the redstone torches health9tick each second, subtract one per second), how to put a block in the game, and how to make those blocks give off redstone power.
Here is coding, I still need basic block entry, and redstone application.
mod_Core
package net.minecraft.src;
public class mod_Core extends BaseMod
{
public static final Block mod_Core = new Core(200, 0).setBlockName("mod_Core").setHardness(3F).setResistance(4F).setLightValue(12F);
public void load()
{
mod_Core.blockIndexInTexture = ModLoader.addOverride("/gui/item.png", "/C:/Users/Anthony/Desktop/core.png");
ModLoader.registerBlock(mod_Core);
ModLoader.addName(mod_Core, "Core");
ModLoader.addRecipe(new ItemStack(mod_Core, 1), new Object [] {"#", "#", Character.valueOf('#'), Block.dirt});
}
public String getVersion()
{
return "1.3.1";
}
}
Core
package net.minecraft.src;
import java.util.Random;
public class Core extends Block
{
public Core(int i, int j)
{
super(200, 0, Material.rock);
}
public int id200(int i, Random random, int j)
{
return mod_Core.mod_Core.blockID;
}
public int quantity1(Random random)
{
return 1;
}
}
Hm, I'd read the classes Block, BlockRedstoneTorch. I don't know about tickupdates but you'd have to change how it ticks...because currently it looks like every tick it checks whether or not it is powered and updates based on that. Sorry and best of luck, i'll keep looking into this
EDIT: Maybe, in BlockRedstoneTorch.checkForBurnout(...), before the return false statement, add a wait(time in ms to wait)
Hey, I'd like to know how you make blocks (specifically solid flower-like blocks) directional. By that, I mean like with a piston, how when you look above you and place that block, the block faces downwards. Another thing, I'd like to know how to make the item icon for previously mentioned block be the proper one, because as it stands, the texture in the inventory is a gray grass top. One more thing, I'd like to know how to make blocks hurt people upon being touched. Thanks in advance!
Right now I need to know how to add health or a timer to an item, make it tick, changing once every second, etc.
I'll see what I can do with trial and error, IF I COULD EVEN GET THE DAMNED BLOCK IN!!!!!
Seriously, for the entire time here I've been askign one thing.
How do I enter a simple
block into the game?
And you know what, NOT A SINGLE ANSWER ON HOW THIS IS DONE.
I mean, yeah, what the tutorial says is pretty basic, I even followed it all the way through, had someone check it after my fifth post of asking, and even that fixed coding didn't work.
All I need is a simple block implemented into the game. I can lear what I need, how I make it, and all that from the block's code, and from there, I'll enter in several more blocks on my own, but if I can't figure out how to get one fricken block in, how am I supposed to do that?
Right now I need to know how to add health or a timer to an item, make it tick, changing once every second, etc.
I'll see what I can do with trial and error, IF I COULD EVEN GET THE DAMNED BLOCK IN!!!!!
Seriously, for the entire time here I've been askign one thing.
How do I enter a simple
block into the game?
And you know what, NOT A SINGLE ANSWER ON HOW THIS IS DONE.
I mean, yeah, what the tutorial says is pretty basic, I even followed it all the way through, had someone check it after my fifth post of asking, and even that fixed coding didn't work.
All I need is a simple block implemented into the game. I can lear what I need, how I make it, and all that from the block's code, and from there, I'll enter in several more blocks on my own, but if I can't figure out how to get one fricken block in, how am I supposed to do that?
...maybe don't name the block the same as the class name? :s
Hey, I'd like to know how you make blocks (specifically solid flower-like blocks) directional. By that, I mean like with a piston, how when you look above you and place that block, the block faces downwards. Another thing, I'd like to know how to make the item icon for previously mentioned block be the proper one, because as it stands, the texture in the inventory is a gray grass top. One more thing, I'd like to know how to make blocks hurt people upon being touched. Thanks in advance!
Hey super, a few things. I'll start with the note about contact.
There is a method to tell when an entity collides with the block:
public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity) { <code> }
Implement that method in your BlockBlockName class and give the entity some damage. Best way to do damage is like this:
public void onEntityCollideWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity) {
par5Entity.attackEntityFrom(new DamageSource("Block's Name"), x //x is the amount of damage dealt);
}
I would *highly* recommend to alter the bounding box to mimic a cactus if you want it to do damage on collision. Methods needed to do this: (it broke sorry, this just causes suffocation damage. Couldn't figure out how to legitimately make a bigger collisionbox.)
Right now I need to know how to add health or a timer to an item, make it tick, changing once every second, etc.
I'll see what I can do with trial and error, IF I COULD EVEN GET THE DAMNED BLOCK IN!!!!!
Seriously, for the entire time here I've been askign one thing.
How do I enter a simple
block into the game?
And you know what, NOT A SINGLE ANSWER ON HOW THIS IS DONE.
I mean, yeah, what the tutorial says is pretty basic, I even followed it all the way through, had someone check it after my fifth post of asking, and even that fixed coding didn't work.
All I need is a simple block implemented into the game. I can lear what I need, how I make it, and all that from the block's code, and from there, I'll enter in several more blocks on my own, but if I can't figure out how to get one fricken block in, how am I supposed to do that?
public static final Block AwesomeBlock = new Block(200,0).setBlockName("AwesomeBlock").setResistance(3F).setHardness(3F).setLightValue(5F);
That creates a new block.
(Anyway, sorry I haven't been helping all you guys out lately, I've been having 1.3.1 problems )
This video did not help what so ever.
Btw, thx for the tutorials on modding with modloader, much more easier.
I want to make a mod with new ores and tools for there, but I don't know how do this. Please update the Tool tutorial!
TechGuy, your tutorials are very nice!
Sorry for bad english!
FBalazs
src\minecraft\net\minecraft\src\mod_Ninja.java:12: error: '}' expected
ModLoader.addRecipe(new ItemStack(sword, 1), new Object [] {" #" " #" "% " Char
acter.valueOf('#'), Item.ingotIron, Character.valueOf('%'), Item.stick});
^
src\minecraft\net\minecraft\src\mod_Ninja.java:12: error: ';' expected
ModLoader.addRecipe(new ItemStack(sword, 1), new Object [] {" #" " #" "% " Char
acter.valueOf('#'), Item.ingotIron, Character.valueOf('%'), Item.stick});
^
src\minecraft\net\minecraft\src\mod_Ninja.java:12: error: ';' expected
ModLoader.addRecipe(new ItemStack(sword, 1), new Object [] {" #" " #" "% " Char
acter.valueOf('#'), Item.ingotIron, Character.valueOf('%'), Item.stick});
^
src\minecraft\net\minecraft\src\mod_Ninja.java:12: error: not a statement
ModLoader.addRecipe(new ItemStack(sword, 1), new Object [] {" #" " #" "% " Char
acter.valueOf('#'), Item.ingotIron, Character.valueOf('%'), Item.stick});
^
src\minecraft\net\minecraft\src\mod_Ninja.java:12: error: ';' expected
ModLoader.addRecipe(new ItemStack(sword, 1), new Object [] {" #" " #" "% " Char
acter.valueOf('#'), Item.ingotIron, Character.valueOf('%'), Item.stick});
^
src\minecraft\net\minecraft\src\mod_Ninja.java:12: error: ';' expected
ModLoader.addRecipe(new ItemStack(sword, 1), new Object [] {" #" " #" "% " Char
acter.valueOf('#'), Item.ingotIron, Character.valueOf('%'), Item.stick});
^
src\minecraft\net\minecraft\src\mod_Ninja.java:12: error: not a statement
ModLoader.addRecipe(new ItemStack(sword, 1), new Object [] {" #" " #" "% " Char
acter.valueOf('#'), Item.ingotIron, Character.valueOf('%'), Item.stick});
^
src\minecraft\net\minecraft\src\mod_Ninja.java:12: error: ';' expected
ModLoader.addRecipe(new ItemStack(sword, 1), new Object [] {" #" " #" "% " Char
acter.valueOf('#'), Item.ingotIron, Character.valueOf('%'), Item.stick});
^
src\minecraft\net\minecraft\src\mod_Ninja.java:12: error: illegal start of type
ModLoader.addRecipe(new ItemStack(sword, 1), new Object [] {" #" " #" "% " Char
acter.valueOf('#'), Item.ingotIron, Character.valueOf('%'), Item.stick});
^
src\minecraft\net\minecraft\src\mod_Ninja.java:16: error: class, interface, or e
num expected
public String getVersion()
^
src\minecraft\net\minecraft\src\mod_Ninja.java:19: error: class, interface, or e
num expected
}
^
Here is the recipe I am shooting for
Most of the errors are from the recipe but when I change to what it wants, more errors and it's not what your template looks like. a lot are also from the mod_Ninja file.
Here's my code.
mod_Ninja
public class mod_Ninja extends BaseMod
{
public static final Item sword = new ItemKatana(2003, EnumToolMaterialIron.IRON).setItemName("Katana");
public void load()
{
sword.iconIndex = ModLoader.addOverride("/gui/items.png", "/mods/Katana.png");
ModLoader.addName(sword, "Katana");
ModLoader.addRecipe(new ItemStack(sword, 1), new Object [] {" #" " #" "% " Character.valueOf('#'), Item.ingotIron, Character.valueOf('%'), Item.stick});
}
public String getVersion()
{
return "1.3.1";
}
}
ItemKatana
public class ItemKatana extends Item
{
private int weaponDamage;
private final EnumToolMaterialIron toolMaterial;
public ItemKatana(int par1, EnumToolMaterialIron par2EnumToolMaterialIron)
{
super(par1);
toolMaterial = par2EnumToolMaterialIron;
maxStackSize = 1;
setMaxDamage(par2EnumToolMaterialIron.getMaxUses());
weaponDamage = 6 + par2EnumToolMaterialIron.getDamageVsEntity();
}
/**
* 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)
{
return par2Block.blockID != Block.web.blockID ? 1.5F : 15F;
}
/**
* Current implementations of this method in foal classes do not use the entry argument beside ev. They just raise
* the damage on the stack.
*/
public boolean hitEntity(ItemStack par1ItemStack, EntityLiving par2EntityLiving, EntityLiving par3EntityLiving)
{
par1ItemStack.damageItem(1, par3EntityLiving);
return true;
}
public boolean onBlockDestroyed(ItemStack par1ItemStack, int par2, int par3, int par4, int par5, EntityLiving par6EntityLiving)
{
par1ItemStack.damageItem(2, par6EntityLiving);
return true;
}
/**
* Returns the damage against a given entity.
*/
public int getDamageVsEntity(Entity par1Entity)
{
return weaponDamage;
}
/**
* Returns True is the item is renderer in full 3D when hold.
*/
public boolean isFull3D()
{
return true;
}
/**
* returns the action that specifies what animation to play when the items is being used
*/
public EnumAction getItemUseAction(ItemStack par1ItemStack)
{
return EnumAction.block;
}
/**
* How long it takes to use or consume an item
*/
public int getMaxItemUseDuration(ItemStack par1ItemStack)
{
return 600;
}
/**
* Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer
*/
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
par3EntityPlayer.setItemInUse(par1ItemStack, getMaxItemUseDuration(par1ItemStack));
return par1ItemStack;
}
/**
* Returns if the item (tool) can harvest results from the block type.
*/
public boolean canHarvestBlock(Block par1Block)
{
return par1Block.blockID == Block.web.blockID;
}
/**
* Return the enchantability factor of the item, most of the time is based on material.
*/
public int getItemEnchantability()
{
return toolMaterial.getEnchantability();
}
public String func_77825_f()
{
return this.toolMaterial.toString();
}
}
What do I put if I want the ToolMaterial to be iron? Thanks in advance.
First, check up on your coding itself: the block variable crate needs to be an instance of Block. Plus it's full of errors. Example code:
Next, check your method names, like ModLoader.addName <- you didn't capitalize the 'N' in addName; ModLoader.registerBlock; <- you didn't capitalize the B in registerBlock.
Hope this helps!
http://www.planetminecraft.com/blog/125-halo-3-weapons---custom-content-for-flans-mods/
Add this line of code in the load() method:
Where "blockNameHere" is the name of the variable itself.
http://www.planetminecraft.com/blog/125-halo-3-weapons---custom-content-for-flans-mods/
thanks i changed it and now i have one error
src\minecraft\net\minecraft\src\blockcrate.java:11: error: ';' expected return mod_block.crate.160;
code
and my blockCrate class
Try changing this line:
To this:
Not sure, but this should work.
Just have to warn you, be very careful with your code. I tried cleaning it up a bit, you had 2 different names for your BlockCrate class, a few misspellings, and some illegal arguments. I don't generally like to fix code entirely for people, but maybe you can see what's going on when it's working:
And this for your BlockCrate class:
http://www.planetminecraft.com/blog/125-halo-3-weapons---custom-content-for-flans-mods/
Repost code/question? :3
http://www.planetminecraft.com/blog/125-halo-3-weapons---custom-content-for-flans-mods/
i did that and now i have a new error
src\minecraft\net\minecraft\src\BlockCrate.java:5: error: invalid method declaration; return required
public type required
public crate(int i, int j)
oops. my bad. Change the method name to this:
http://www.planetminecraft.com/blog/125-halo-3-weapons---custom-content-for-flans-mods/
EDIT: Maybe, in BlockRedstoneTorch.checkForBurnout(...), before the return false statement, add a wait(time in ms to wait)
http://www.planetminecraft.com/blog/125-halo-3-weapons---custom-content-for-flans-mods/
I'll see what I can do with trial and error, IF I COULD EVEN GET THE DAMNED BLOCK IN!!!!!
Seriously, for the entire time here I've been askign one thing.
How do I enter a simple
block into the game?
And you know what, NOT A SINGLE ANSWER ON HOW THIS IS DONE.
I mean, yeah, what the tutorial says is pretty basic, I even followed it all the way through, had someone check it after my fifth post of asking, and even that fixed coding didn't work.
All I need is a simple block implemented into the game. I can lear what I need, how I make it, and all that from the block's code, and from there, I'll enter in several more blocks on my own, but if I can't figure out how to get one fricken block in, how am I supposed to do that?
...maybe don't name the block the same as the class name? :s
http://www.planetminecraft.com/blog/125-halo-3-weapons---custom-content-for-flans-mods/
Hey super, a few things. I'll start with the note about contact.
There is a method to tell when an entity collides with the block:
Implement that method in your BlockBlockName class and give the entity some damage. Best way to do damage is like this:
I would *highly* recommend to alter the bounding box to mimic a cactus if you want it to do damage on collision. Methods needed to do this: (it broke sorry, this just causes suffocation damage. Couldn't figure out how to legitimately make a bigger collisionbox.)
As far as the other two questions, can you post what code you have atm? I could take a look at it
http://www.planetminecraft.com/blog/125-halo-3-weapons---custom-content-for-flans-mods/
That creates a new block.
(Anyway, sorry I haven't been helping all you guys out lately, I've been having 1.3.1 problems )