You have been so helpful
Your tutorials are great.
I have another question if you don't mind. Right now, I have a way to make it a chance to drop items. My code goes like this:
public int quantityDropped(Random par1Random){
return par1Random.nextInt(2) == 0 ? 1 : 0;
}
Right now, it either drops all items, or no items. Is it possible to give each item a chance to drop or not?
Thx anyway
I found a workaround to this problem, add these three voids to your BlockName.java:
public int idDropped(int par1, Random par2Random, int par3){
return mod_fun.funBlock.blockID;
}
public int idDropped2(int par1, Random par2Random, int par3){
return mod_fun.mineralBlock.blockID;
}
public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7){
if (!par1World.isRemote){
int var8 = this.quantityDroppedWithBonus(par7, par1World.rand);
for (int var9 = 0; var9 < var8; ++var9)
{
if (par1World.rand.nextFloat() <= par6)
{
int var10 = this.idDropped2(par5, par1World.rand, par7);
int var11 = this.idDropped(par5, par1World.rand, par7);
if (var10 > 0)
{
this.dropBlockAsItem_do(par1World, par2, par3, par4, new ItemStack(var10, 1, this.damageDropped(par5)));
this.dropBlockAsItem_do(par1World, par2, par3, par4, new ItemStack(var11, 1, this.damageDropped(par5)));
}
}
}
}
}
I tried that, but isn't that for making the same item have a chance to drop another? Cause I have already figured out away to make 0-2 of the same item drop. I wanted to know how to make a block drop different items when broken.
I was wondering how I might go about making a block drop several items when broken. I looked at minecraft's vanilla code, but couldn't find how to make several things drop.
Hi guys. How would I go about making a block drop more than one item? I have made a block, and 6 items that I would like to drop from it when it is mined. But I couldn't figure out how to code that. Any advice would help. Thanks
I'm having a problem with adding my block. I did the code just like you did, and got no errors at all. But when I load up MC, the block doesn't show up in the creative menu. I decided to add a crafting recipe for it, and temporarily made it one piece of dirt. But when I put the block in, the game crashed.
This is part of the crash code
at net.minecraft.src.ModLoader.initStats(ModLoader.java:837)
at net.minecraft.src.ModLoader.init(ModLoader.java:810)
at net.minecraft.src.ModLoader.addAllRenderers(ModLoader.java:180)
at net.minecraft.src.RenderManager.(RenderManager.java:96)
at net.minecraft.src.RenderManager.(RenderManager.java:14)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:417)
at net.minecraft.src.MinecraftAppletImpl.startGame(MinecraftAppletImpl.java:41)
at net.minecraft.client.Minecraft.run(Minecraft.java:726)
at java.lang.Thread.run(Unknown Source)
By the way, I really like your tutorials, keep it up
I really like your mob tutorial, but I get an error. When I type "publicvoid addRenderer(Map var1){" Map gets an error. It says "Map cannot be resolved to a type". Also, how do I know if the mobs are spawning? Do they act like animals and rarely spawn?
Hi
I was trying to use your code for how to add food, but I got an error. Basically the constructor with the item int int float boolean doesn't work D:
Any fix for this, or is there a mistake in the code?
MiniMax, I was wondering if I could make a lets play on Castaway with my cousin, I would tell viewers about you and your maps.
That would be greatly appreciated! I'll PM you just in case you don't see this. Ill subscribe for sure if you start
By the way, It's MinMax, not Minimax
0
Your tutorials are great.
I have another question if you don't mind. Right now, I have a way to make it a chance to drop items. My code goes like this:
Right now, it either drops all items, or no items. Is it possible to give each item a chance to drop or not?
Thx anyway
0
Yeah, that's what I already have. I wanted to know how to make a block drop 6 different things when mined. Is that possible?
0
I tried that, but isn't that for making the same item have a chance to drop another? Cause I have already figured out away to make 0-2 of the same item drop. I wanted to know how to make a block drop different items when broken.
0
0
0
Risugami helped me out here, and you missed a line of code in your tutorial. I didn't register the block.
0
This is part of the crash code
By the way, I really like your tutorials, keep it up
0
THx
0
Map gets an error. It says "Map cannot be resolved to a type". Also, how do I know if the mobs are spawning? Do they act like animals and rarely spawn?
0
0
I was trying to use your code for how to add food, but I got an error. Basically the constructor with the item int int float boolean doesn't work D:
Any fix for this, or is there a mistake in the code?
0
0
That would be greatly appreciated! I'll PM you just in case you don't see this. Ill subscribe for sure if you start
By the way, It's MinMax, not Minimax
0
0
至少他们张贴的链接