I made a block for my mod and it just breaks in 1 hit. Does anyone know how I can make it so it takes awhile to hit like a Anvil? I can post any code if needed.
You need to set the hardness and resistance of the block, this is done under the block.java you created
so it would be something like
public CustomBlock(String name, Material material, float hardness, float resistance)
(
super(material)
setUnlocalizedName(name);
setRegistryName(name);
setHardness(hardness);
setResistance(resistance);
do not copy my code exact, i am a novice, but this is how I did it, then you just replace hardness and resistance with the number you want, I would look up existing values for vanilla blocks to get an idea, make sure you follow the number you place with an F ( 0.8F )
I made a block for my mod and it just breaks in 1 hit. Does anyone know how I can make it so it takes awhile to hit like a Anvil? I can post any code if needed.
Thanks in advanced!
You need to set the hardness and resistance of the block, this is done under the block.java you created
so it would be something like
public CustomBlock(String name, Material material, float hardness, float resistance)
(
super(material)
setUnlocalizedName(name);
setRegistryName(name);
setHardness(hardness);
setResistance(resistance);
do not copy my code exact, i am a novice, but this is how I did it, then you just replace hardness and resistance with the number you want, I would look up existing values for vanilla blocks to get an idea, make sure you follow the number you place with an F ( 0.8F )