dont put your assets packages under src/main/resources put them under src/main/java
Why would Forge create a resources folder if we're not supposed to put resources in it? I think you are giving dangerous advice here.
Assets such as textures and the language file belong in paths that look like:
Forge\src\main\resources\assets\<MODID>\textures\items...
or
Forge\src\main\resources\assets\<MODID>\lang...
And the mcmod.info file belongs in resources itself.
If that's not working for somebody, then either their setup is off the Forge standard, or else they're not correctly using their path info in their code. See how vanilla Minecraft organizes assets in the net\minecraft\assets\... heirarchy, and then imitate that in your own (your modid in your folder paths takes the place of "minecraft" in vanilla). Everything below that should match exactly.
Imitating the vanilla structure will bring the vanilla code onto your side. Doing otherwise will mean needing to override more methods, and then you run the risk of something not happening like it should.
EDIT:
In the case of Ebony Ore, the PNG file needs to be one level deeper. Put it in a "blocks" folder under "textures". Eclipse can be a pain when trying to work in deep nested folders, so I would use the filesystem itself to create folders as needed. Then Eclipse can refresh to see what you did.
Why would Forge create a resources folder if we're not supposed to put resources in it? I think you are giving dangerous advice here.
Assets such as textures and the language file belong in paths that look like:
Forge\src\main\resources\assets\<MODID>\textures\items...
or
Forge\src\main\resources\assets\<MODID>\lang...
And the mcmod.info file belongs in resources itself.
If that's not working for somebody, then either their setup is off the Forge standard, or else they're not correctly using their path info in their code. See how vanilla Minecraft organizes assets in the net\minecraft\assets\... heirarchy, and then imitate that in your own (your modid in your folder paths takes the place of "minecraft" in vanilla). Everything below that should match exactly.
Imitating the vanilla structure will bring the vanilla code onto your side. Doing otherwise will mean needing to override more methods, and then you run the risk of something not happening like it should.
EDIT:
In the case of Ebony Ore, the PNG file needs to be one level deeper. Put it in a "blocks" folder under "textures". Eclipse can be a pain when trying to work in deep nested folders, so I would use the filesystem itself to create folders as needed. Then Eclipse can refresh to see what you did.
I think it will work either way, depending on how you like to organize your workplace. For me, i like having all of my folders in one place, if it were up to me, i'd get rid of the src/main/resources for good, but forge recommends that you have an mcmod.info file and it can only detect it if it's placed in the src/main/ressources folder.
Only problem I've run into, and this is in your World Generation tutorial, is the entire thing. In the main file, the GameRegistry.registerWorldGenerator(worldGen); requires a modGenerationWeight integer otherwise it will return an error. (Fairly simple fix.)
In the TutWorldGenerator class, two things are wrong. Either your missing the defining of "int i" or it has to be a for loop; otherwise you get a whole bunch of errors (syntax, i being unresolvable as an int, etc). The next is a problem with "chunkY"; chunkY doesn't exist in any of the three classes and, when you pass it to WorldGenTut.java, you call it "int y". (I'm not quite sure what you mean to pass with chunkY; or if you meant to pass x, y, and z.)
Speaking of WorldGenTut.java, the public void generate(...) {} does work; but it only works when you fix it the way the error wants it. Setting it your way creates an error and making the class abstract only makes an error in TutWorldGenerator.java. (Working on a fix for this to see what works and I'll hand you the fix once I find it.)
Found the error in WorldGenTut! Instead of implements IWorldGenerator, use extends WorldGenerator. This removes the error although from what I've seen from jajo_11's code (I used his .schematic to .java conversion thing because I got lazy and didn't want to have to custom write the Menoa Tree from the Eragon series) you have to use a public boolean generate(...) instead of a public voidgenerate(...).
Hi there i have made custom slabs in minecraft but i don't know how to make the stack when placed and have them be able to be place upside down. Does anyone here know how to do that and can help me out?
Here is my code for the block:
package com.zeldanerd123.pikminsmostuff.blocks.treestuff.slabs;
import com.zeldanerd123.pikminsmostuff.PikminsMoStuff;
import net.minecraft.block.Block;
import net.minecraft.block.BlockSlab;
import net.minecraft.block.material.Material;
public class AutumnPlanksSlabs extends Block {
public AutumnPlanksSlabs(Material wood) {
super(wood);
this.setBlockBounds(0.0f, 0.0f, 0.0f, 1.0f, 0.5f, 1.0f);
this.setBlockTextureName(PikminsMoStuff.MODID + ":autumn_oak_planks");
this.setCreativeTab(PikminsMoStuff.PikminsBlocks);
this.setHardness(2f);
this.setLightOpacity(0);
this.setBlockName("AutumnPlanksSlabs");
}
public boolean isOpaqueCube()
{
return false;
}
public boolean renderAsNormalBlock()
{
return false;
}
}
Also I made a custom tree log but when i place the block side ways only the side textures rotate here is the code for the tree log:
cn you please show us how to make mob drops rare, thanks.
The quickest way I know how to do it at 2AM is to have two Random variables. One that controls the drop and another that controls how often it drops.The spoiler below pulls/adds onto one of my classes.
public class DropHandler {
public static Random random;
public static int dropped;
public static Random dropModifier = new Random(6); //Or whatever you name it and however high you make it. Remember: The higher with less parameters/integers being called from it, the more "rare" it is
@SubscribedEvent
public void onEntityDrop(LivingDropsEvent event) {
random = new Random();
if((event.entityLiving instanceof EntitySheep && (dropModifier == 1 || dropModifier == 2 || .. Continue on however many times you like/with whatever you want..)) {
//Whatever you put into this class/follow Ian's tutorial
cn you please show us how to make mob drops rare, thanks.
The quickest way I know how to do it at 2AM is to have two Random variables. One that controls the drop and another that controls how often it drops.The spoiler below pulls/adds onto one of my classes.
public class DropHandler {
public static Random random;
public static int dropped;
public static Random dropModifier = new Random(6); //Or whatever you name it and however high you make it. Remember: The higher with less parameters/integers being called from it, the more "rare" it is
@SubscribedEvent
public void onEntityDrop(LivingDropsEvent event) {
random = new Random();
if((event.entityLiving instanceof EntitySheep && (dropModifier == 1 || dropModifier == 2 || .. Continue on however many times you like/with whatever you want..)) {
//Whatever you put into this class/follow Ian's tutorial
}
}
}
Im sorry, but I got errors under .. Continue on however many times you like/with whatever you want..)) { and dropModifier == 1
cn you please show us how to make mob drops rare, thanks.
The quickest way I know how to do it at 2AM is to have two Random variables. One that controls the drop and another that controls how often it drops.The spoiler below pulls/adds onto one of my classes.
public class DropHandler {
public static Random random;
public static int dropped;
public static Random dropModifier = new Random(6); //Or whatever you name it and however high you make it. Remember: The higher with less parameters/integers being called from it, the more "rare" it is
@SubscribedEvent
public void onEntityDrop(LivingDropsEvent event) {
random = new Random();
if((event.entityLiving instanceof EntitySheep && (dropModifier == 1 || dropModifier == 2 || .. Continue on however many times you like/with whatever you want..)) {
//Whatever you put into this class/follow Ian's tutorial
}
}
}
Im sorry, but I got errors under .. Continue on however many times you like/with whatever you want..)) { and dropModifier == 1
cn you please show us how to make mob drops rare, thanks.
The quickest way I know how to do it at 2AM is to have two Random variables. One that controls the drop and another that controls how often it drops.The spoiler below pulls/adds onto one of my classes.
public class DropHandler {
public static Random random;
public static int dropped;
public static Random dropModifier = new Random(6); //Or whatever you name it and however high you make it. Remember: The higher with less parameters/integers being called from it, the more "rare" it is
@SubscribedEvent
public void onEntityDrop(LivingDropsEvent event) {
random = new Random();
if((event.entityLiving instanceof EntitySheep && (dropModifier == 1 || dropModifier == 2 || .. Continue on however many times you like/with whatever you want..)) {
//Whatever you put into this class/follow Ian's tutorial
}
}
}
Im sorry, but I got errors under .. Continue on however many times you like/with whatever you want..)) { and dropModifier == 1
What are the errors?
I get syntax error on .. Continue on however many times you like/with whatever you want..)) { and dropModifier == 1, and I am told to delete these tokens. if I delete .. Continue on however many times you like/with whatever you want.. and replace it wit a number ( I think your soposed to do that.)m I get that it is incompatible types.
cn you please show us how to make mob drops rare, thanks.
The quickest way I know how to do it at 2AM is to have two Random variables. One that controls the drop and another that controls how often it drops.The spoiler below pulls/adds onto one of my classes.
public class DropHandler {
public static Random random;
public static int dropped;
public static Random dropModifier = new Random(6); //Or whatever you name it and however high you make it. Remember: The higher with less parameters/integers being called from it, the more "rare" it is
@SubscribedEvent
public void onEntityDrop(LivingDropsEvent event) {
random = new Random();
if((event.entityLiving instanceof EntitySheep && (dropModifier == 1 || dropModifier == 2 || .. Continue on however many times you like/with whatever you want..)) {
//Whatever you put into this class/follow Ian's tutorial
}
}
}
Im sorry, but I got errors under .. Continue on however many times you like/with whatever you want..)) { and dropModifier == 1
What are the errors?
I get syntax error on .. Continue on however many times you like/with whatever you want..)) { and dropModifier == 1, and I am told to delete these tokens. if I delete .. Continue on however many times you like/with whatever you want.. and replace it wit a number ( I think your soposed to do that.)m I get that it is incompatible types.
Ah, sorry about both the long weight and wrong code. This is what it should be (again, modifying my own dropHandler):
public class DropHandler {
public static Random random;
public static int dropped;
public static Random dropMultiplier;
public static in dMint;
@SubscribedEvent
public void onEntityDrop(LivingDropsEvent event) {
random = new Random();
dropMultiplier = new Random();
dMInt = dropMultiplier.nextInt(4)+1;
if (event.entityLiving instance of EntitySheep && (dMInt == 1 || dMInt == 2) {
//Drop goes here
}
}
The quickest way I know how to do it at 2AM is to have two Random variables. One that controls the drop and another that controls how often it drops.The spoiler below pulls/adds onto one of my classes.
public class DropHandler {
public static Random random;
public static int dropped;
public static Random dropModifier = new Random(6); //Or whatever you name it and however high you make it. Remember: The higher with less parameters/integers being called from it, the more "rare" it is
@SubscribedEvent
public void onEntityDrop(LivingDropsEvent event) {
random = new Random();
if((event.entityLiving instanceof EntitySheep && (dropModifier == 1 || dropModifier == 2 || .. Continue on however many times you like/with whatever you want..)) {
//Whatever you put into this class/follow Ian's tutorial
}
}
}
Im sorry, but I got errors under .. Continue on however many times you like/with whatever you want..)) { and dropModifier == 1
What are the errors?
I get syntax error on .. Continue on however many times you like/with whatever you want..)) { and dropModifier == 1, and I am told to delete these tokens. if I delete .. Continue on however many times you like/with whatever you want.. and replace it wit a number ( I think your soposed to do that.)m I get that it is incompatible types.
Ah, sorry about both the long weight and wrong code. This is what it should be (again, modifying my own dropHandler):
public class DropHandler {
public static Random random;
public static int dropped;
public static Random dropMultiplier;
public static in dMint;
@SubscribedEvent
public void onEntityDrop(LivingDropsEvent event) {
random = new Random();
dropMultiplier = new Random();
dMInt = dropMultiplier.nextInt(4)+1;
if (event.entityLiving instance of EntitySheep && (dMInt == 1 || dMInt == 2) {
//Drop goes here
}
}
}
yeah, I had to fix many errors but it all comes down to the 'in' inside of ' public static in dMint', it is in canot be resolved to a type
I noticed that there wasn't much info on extra things that blocks can do. I made a list and class to show how to do them
Adding drops to blocks
adding sounds to blocks
how strong the block is
blast resistance of the block
what tool can break the block
how strong a tool must be to break the block
how to add random amount of blocks
the blocks .java file is below. for the purposes of this exspanation, I will use a block called bone ore. here is its file
package com.example.dragonborn.blocks;
import java.util.Random;
import com.example.dragonborn.dragonborn;
import cpw.mods.fml.common.registry.GameRegistry;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
public class BlockBoneore extends Block {
// the next three lines is what i do diffrently than the first tutorial
public static final Block Boneore = null;
public BlockBoneore(int i, Material rock) {
super(rock);
// you should just copy the 3 lines above and replace "BlockBoneore" with you blocks name, and replace 'Material.rock' with 'Material.material'
this.setStepSound(soundTypeStone); // sets the sound
this.setHardness(55f); // sets how long t takes to break, dirt is 0.5f, so this block is hard to brake
this.setResistance(30f);// blast resistance
this.setBlockTextureName("dragonborn:DragonBoneROck");// how i set its texture. normal way doesn't work for me.
this.setBlockName("Dragon Bone Ore"); // the blocks unlocalized name. doesen't really mater, but should be named diffrent than all of your other blocks.
this.setHarvestLevel("pickaxe", 3);// this blocks tool is know a pickaxe and it can only be broken with a diamond pickaxe, or 3(A diamond level tool)
}
//below, until it gets to return 1;, is how many items the block will drop
@Override
public int quantityDropped(Random random)
{
return 1;
}
//below is registering the item it will drop. my mod is called dragonborn, and the item i want it to drop is an eggshell(a custom item), so I put dragonborn.Eggshell.
public Item idDropped(int par1, Random par2Random, int par3){
return dragonborn.Eggshell;}}
Hi there i have made custom slabs in minecraft but i don't know how to make the stack when placed and have them be able to be place upside down. Does anyone here know how to do that and can help me out?
Here is my code for the block:
package com.zeldanerd123.pikminsmostuff.blocks.treestuff.slabs;
import com.zeldanerd123.pikminsmostuff.PikminsMoStuff;
import net.minecraft.block.Block;
import net.minecraft.block.BlockSlab;
import net.minecraft.block.material.Material;
public class AutumnPlanksSlabs extends Block {
public AutumnPlanksSlabs(Material wood) {
super(wood);
this.setBlockBounds(0.0f, 0.0f, 0.0f, 1.0f, 0.5f, 1.0f);
this.setBlockTextureName(PikminsMoStuff.MODID + ":autumn_oak_planks");
this.setCreativeTab(PikminsMoStuff.PikminsBlocks);
this.setHardness(2f);
this.setLightOpacity(0);
this.setBlockName("AutumnPlanksSlabs");
}
public boolean isOpaqueCube()
{
return false;
}
public boolean renderAsNormalBlock()
{
return false;
}
}
Also I made a custom tree log but when i place the block side ways only the side textures rotate here is the code for the tree log:
Im sorry, but I got errors under .. Continue on however many times you like/with whatever you want..)) { and dropModifier == 1
What are the errors?
I get syntax error on .. Continue on however many times you like/with whatever you want..)) { and dropModifier == 1, and I am told to delete these tokens. if I delete .. Continue on however many times you like/with whatever you want.. and replace it wit a number ( I think your soposed to do that.)m I get that it is incompatible types.
Ah, sorry about both the long weight and wrong code. This is what it should be (again, modifying my own dropHandler):
public class DropHandler {
public static Random random;
public static int dropped;
public static Random dropMultiplier;
public static in dMint;
@SubscribedEvent
public void onEntityDrop(LivingDropsEvent event) {
random = new Random();
dropMultiplier = new Random();
dMInt = dropMultiplier.nextInt(4)+1;
if (event.entityLiving instance of EntitySheep && (dMInt == 1 || dMInt == 2) {
//Drop goes here
}
}
}
yeah, I had to fix many errors but it all comes down to the 'in' inside of ' public static in dMint', it is in canot be resolved to a type
thanks! it worked. however, do you know what I have to change to make my item drop more, and while we are on the subject of drops, can you also please show me how to add MULTIPLE drops to a block? for example, I would like a block that drops both carrots and wheat. do you know how to do that?
thanks! it worked. however, do you know what I have to change to make my item drop more, and while we are on the subject of drops, can you also please show me how to add MULTIPLE drops to a block? for example, I would like a block that drops both carrots and wheat. do you know how to do that?
public class DropHandler {
public static Random random;
public static int dropped;
public static Random dropMultiplier;
public static in dMint;
@SubscribedEvent
public void onEntityDrop(LivingDropsEvent event) {
random = new Random();
dropMultiplier = new Random();
dMInt = dropMultiplier.nextInt(4)+1;
if (event.entityLiving instance of EntitySheep && (dMInt == 1 || dMInt == 2) {
dropped = random.nextInt(4)+1; //Change this one to whatever you want/the number inside the parenthesis
event.entityLiving.entityDropItem(new ItemStack(/*Whatever you want*/), dropped);
event.entityLiving.entityDropItem(new ItemStack(/*Whatever you want*/), dropped); //If you want a custom amount for this one, setup something similar to the variable "dropped"
} // this is for an entity
}
As for blocks, I'm not too sure as of now. I have a feeling it's almost the same as the entityLiving one but just a different set up. I could be wrong.
public class DropHandler {
public static Random random;
public static int dropped;
public static Random dropMultiplier;
public static in dMint;
@SubscribedEvent
public void onEntityDrop(LivingDropsEvent event) {
random = new Random();
dropMultiplier = new Random();
dMInt = dropMultiplier.nextInt(4)+1;
if (event.entityLiving instance of EntitySheep && (dMInt == 1 || dMInt == 2) {
dropped = random.nextInt(4)+1; //Change this one to whatever you want/the number inside the parenthesis
event.entityLiving.entityDropItem(new ItemStack(/*Whatever you want*/), dropped);
event.entityLiving.entityDropItem(new ItemStack(/*Whatever you want*/), dropped); //If you want a custom amount for this one, setup something similar to the variable "dropped"
} // this is for an entity
}
As for blocks, I'm not too sure as of now. I have a feeling it's almost the same as the entityLiving one but just a different set up. I could be wrong.
this didn't help. I still don't know what to change to make my item drop %50 of the time.
this didn't help. I still don't know what to change to make my item drop %50 of the time.
Change the number inside dMInt = dropMultiplier.nextInt(/* The one in here */)+1; To make it drop 50% of the time (the inside number will be 10), you set:
if (event.entityLiving instance of EntitySheep && (dMInt == 1 || dMInt == 2 || dMInt == 3 || dMInt == 4 || dMInt == 5) {...}
Set your dMInt variable to anything that can be divisible by 2 (keep it low so you don't have to write as much).
Minecraft IS NOT PERFECT; by this I mean, it MAY NOT drop 50% of the time because it is a 50% CHANCE; not a 50%-of-the-time-it-drops. A perfect world would have everything drop 50% of the time and the rest nothing. You may hit the "bitter end" and end up having to kill 7/10 sheep rather than 5/10 because Random is random. It might not pick the 5 numbers you set down once each time; it may pick 1, then 8, etc, etc.
HEY! I FIGURED OUT YOUR PROBLEM! YAY! just put void after all the publics
public void preInit
public void init
public void postInit
Why would Forge create a resources folder if we're not supposed to put resources in it? I think you are giving dangerous advice here.
Assets such as textures and the language file belong in paths that look like:
Forge\src\main\resources\assets\<MODID>\textures\items...
or
Forge\src\main\resources\assets\<MODID>\lang...
And the mcmod.info file belongs in resources itself.
If that's not working for somebody, then either their setup is off the Forge standard, or else they're not correctly using their path info in their code. See how vanilla Minecraft organizes assets in the net\minecraft\assets\... heirarchy, and then imitate that in your own (your modid in your folder paths takes the place of "minecraft" in vanilla). Everything below that should match exactly.
Imitating the vanilla structure will bring the vanilla code onto your side. Doing otherwise will mean needing to override more methods, and then you run the risk of something not happening like it should.
EDIT:
In the case of Ebony Ore, the PNG file needs to be one level deeper. Put it in a "blocks" folder under "textures". Eclipse can be a pain when trying to work in deep nested folders, so I would use the filesystem itself to create folders as needed. Then Eclipse can refresh to see what you did.
I think it will work either way, depending on how you like to organize your workplace. For me, i like having all of my folders in one place, if it were up to me, i'd get rid of the src/main/resources for good, but forge recommends that you have an mcmod.info file and it can only detect it if it's placed in the src/main/ressources folder.
I'll add it to my "To work out for my modding tutorials" list
Only problem I've run into, and this is in your World Generation tutorial, is the entire thing. In the main file, the GameRegistry.registerWorldGenerator(worldGen); requires a modGenerationWeight integer otherwise it will return an error. (Fairly simple fix.)
In the TutWorldGenerator class, two things are wrong. Either your missing the defining of "int i" or it has to be a for loop; otherwise you get a whole bunch of errors (syntax, i being unresolvable as an int, etc). The next is a problem with "chunkY"; chunkY doesn't exist in any of the three classes and, when you pass it to WorldGenTut.java, you call it "int y". (I'm not quite sure what you mean to pass with chunkY; or if you meant to pass x, y, and z.)
Speaking of WorldGenTut.java, the public void generate(...) {} does work; but it only works when you fix it the way the error wants it. Setting it your way creates an error and making the class abstract only makes an error in TutWorldGenerator.java. (Working on a fix for this to see what works and I'll hand you the fix once I find it.)
Otherwise, good job so far!
YouTube: UnitatoGaming
Minecraft: DOOMsolider45
CEO/Co-Founder of Rinato Games and CEO/Founder of Hybridia Studios
YouTube: UnitatoGaming
Minecraft: DOOMsolider45
CEO/Co-Founder of Rinato Games and CEO/Founder of Hybridia Studios
Here is my code for the block:
Also I made a custom tree log but when i place the block side ways only the side textures rotate here is the code for the tree log:
EDIT: If any of you know how to make leaves blocks please tell me how i can't find any tutorials for it. Thank you all for your time.
The quickest way I know how to do it at 2AM is to have two Random variables. One that controls the drop and another that controls how often it drops.The spoiler below pulls/adds onto one of my classes.
public class DropHandler {
public static Random random;
public static int dropped;
public static Random dropModifier = new Random(6); //Or whatever you name it and however high you make it. Remember: The higher with less parameters/integers being called from it, the more "rare" it is
@SubscribedEvent
public void onEntityDrop(LivingDropsEvent event) {
random = new Random();
if((event.entityLiving instanceof EntitySheep && (dropModifier == 1 || dropModifier == 2 || .. Continue on however many times you like/with whatever you want..)) {
//Whatever you put into this class/follow Ian's tutorial
}
}
}
YouTube: UnitatoGaming
Minecraft: DOOMsolider45
CEO/Co-Founder of Rinato Games and CEO/Founder of Hybridia Studios
Im sorry, but I got errors under .. Continue on however many times you like/with whatever you want..)) { and dropModifier == 1
What are the errors?
YouTube: UnitatoGaming
Minecraft: DOOMsolider45
CEO/Co-Founder of Rinato Games and CEO/Founder of Hybridia Studios
I get syntax error on .. Continue on however many times you like/with whatever you want..)) { and dropModifier == 1, and I am told to delete these tokens. if I delete .. Continue on however many times you like/with whatever you want.. and replace it wit a number ( I think your soposed to do that.)m I get that it is incompatible types.
Ah, sorry about both the long weight and wrong code. This is what it should be (again, modifying my own dropHandler):
public class DropHandler {
public static Random random;
public static int dropped;
public static Random dropMultiplier;
public static in dMint;
@SubscribedEvent
public void onEntityDrop(LivingDropsEvent event) {
random = new Random();
dropMultiplier = new Random();
dMInt = dropMultiplier.nextInt(4)+1;
if (event.entityLiving instance of EntitySheep && (dMInt == 1 || dMInt == 2) {
//Drop goes here
}
}
}
YouTube: UnitatoGaming
Minecraft: DOOMsolider45
CEO/Co-Founder of Rinato Games and CEO/Founder of Hybridia Studios
yeah, I had to fix many errors but it all comes down to the 'in' inside of ' public static in dMint', it is in canot be resolved to a type
Is it possible for anyone to help me with this.
Change in to int
YouTube: UnitatoGaming
Minecraft: DOOMsolider45
CEO/Co-Founder of Rinato Games and CEO/Founder of Hybridia Studios
thanks! it worked. however, do you know what I have to change to make my item drop more, and while we are on the subject of drops, can you also please show me how to add MULTIPLE drops to a block? for example, I would like a block that drops both carrots and wheat. do you know how to do that?
public class DropHandler {
public static Random random;
public static int dropped;
public static Random dropMultiplier;
public static in dMint;
@SubscribedEvent
public void onEntityDrop(LivingDropsEvent event) {
random = new Random();
dropMultiplier = new Random();
dMInt = dropMultiplier.nextInt(4)+1;
if (event.entityLiving instance of EntitySheep && (dMInt == 1 || dMInt == 2) {
dropped = random.nextInt(4)+1; //Change this one to whatever you want/the number inside the parenthesis
event.entityLiving.entityDropItem(new ItemStack(/*Whatever you want*/), dropped);
event.entityLiving.entityDropItem(new ItemStack(/*Whatever you want*/), dropped); //If you want a custom amount for this one, setup something similar to the variable "dropped"
} // this is for an entity
}
As for blocks, I'm not too sure as of now. I have a feeling it's almost the same as the entityLiving one but just a different set up. I could be wrong.
YouTube: UnitatoGaming
Minecraft: DOOMsolider45
CEO/Co-Founder of Rinato Games and CEO/Founder of Hybridia Studios
this didn't help. I still don't know what to change to make my item drop %50 of the time.
Change the number inside dMInt = dropMultiplier.nextInt(/* The one in here */)+1; To make it drop 50% of the time (the inside number will be 10), you set:
if (event.entityLiving instance of EntitySheep && (dMInt == 1 || dMInt == 2 || dMInt == 3 || dMInt == 4 || dMInt == 5) {...}
Set your dMInt variable to anything that can be divisible by 2 (keep it low so you don't have to write as much).
Minecraft IS NOT PERFECT; by this I mean, it MAY NOT drop 50% of the time because it is a 50% CHANCE; not a 50%-of-the-time-it-drops. A perfect world would have everything drop 50% of the time and the rest nothing. You may hit the "bitter end" and end up having to kill 7/10 sheep rather than 5/10 because Random is random. It might not pick the 5 numbers you set down once each time; it may pick 1, then 8, etc, etc.
YouTube: UnitatoGaming
Minecraft: DOOMsolider45
CEO/Co-Founder of Rinato Games and CEO/Founder of Hybridia Studios