Skip to content

Instantly share code, notes, and snippets.

@suppergerrie2
Created October 29, 2017 08:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save suppergerrie2/04ee5f30f54505cf0faa747c359cbac2 to your computer and use it in GitHub Desktop.
Save suppergerrie2/04ee5f30f54505cf0faa747c359cbac2 to your computer and use it in GitHub Desktop.
Multiple Items Drop
public class BlockOre extends BlockBasic {
Item toDrop;
int minDropAmount = 1;
int maxDropAmount = 0;
public BlockOre(String name, Material material) {
this(name, material, null, 1, 1);
}
public BlockOre(String name, Material material, Item toDrop) {
this(name, material, toDrop, 1, 1);
}
public BlockOre(String name, Material material, Item toDrop, int dropAmount) {
this(name, material, toDrop, dropAmount, dropAmount);
}
public BlockOre(String name, Material material, Item toDrop, int minDropAmount, int maxDropAmount) {
super(name,material);
this.toDrop = toDrop;
this.minDropAmount = minDropAmount;
this.maxDropAmount = maxDropAmount;
}
@Override
public ArrayList<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState blockstate, int fortune){
ArrayList<ItemStack> drops = new ArrayList<ItemStack>();
drops.add(new ItemStack(Items.REDSTONE, 10));
drops.add(new ItemStack(Items.DIAMOND, RANDOM.nextInt(10)));
return drops;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment