Advertisement
Guest User

Untitled

a guest
Sep 26th, 2016
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.77 KB | None | 0 0
  1. if (material == Material.IRON_ORE && player.getGameMode().equals(GameMode.SURVIVAL)
  2. && player.getItemInHand().getType().toString().toLowerCase().contains("pickaxe")) {
  3.  
  4. Material i1 = Material.COAL;
  5. Material i2 = Material.ARROW;
  6. Material i3 = Material.STICK;
  7. Material i4 = Material.FLINT;
  8. Material i5 = Material.IRON_INGOT;
  9. Material i6 = Material.STRING;
  10. Material i7 = Material.DIAMOND;
  11.  
  12. Material id1 = Material.COAL;
  13. Material id2 = Material.ARROW;
  14. Material id3 = Material.STICK;
  15. Material id4 = Material.FLINT;
  16. Material id5 = Material.DIAMOND;
  17. Material id6 = Material.DIAMOND;
  18. Material id7 = Material.DIAMOND;
  19.  
  20. ironAL.add(i1);
  21. ironAL.add(i2);
  22. ironAL.add(i3);
  23. ironAL.add(i4);
  24. ironAL.add(i5);
  25. ironAL.add(i6);
  26. ironAL.add(i7);
  27.  
  28. idAL.add(id1);
  29. idAL.add(id2);
  30. idAL.add(id3);
  31. idAL.add(id4);
  32. idAL.add(id5);
  33. idAL.add(id6);
  34. idAL.add(id7);
  35.  
  36. Random diceRoll = new Random();
  37. int number;
  38. number = diceRoll.nextInt(6);
  39. Random secondDiceRoll = new Random();
  40. int amountDropped;
  41. amountDropped = secondDiceRoll.nextInt(4);
  42. event.setCancelled(true);
  43. event.getBlock().setType(Material.AIR);
  44.  
  45. event.getBlock().getWorld().dropItemNaturally(event.getBlock().getLocation().add(.5, .5, .5),
  46. new ItemStack(ironAL.get(number), amountDropped + 1));
  47.  
  48. event.getBlock().getWorld().dropItemNaturally(event.getBlock().getLocation().add(.6, .6, .6),
  49. new ItemStack(ironAL.get(number), amountDropped + 1));
  50.  
  51. number = diceRoll.nextInt(7);
  52. amountDropped = secondDiceRoll.nextInt(3);
  53.  
  54. event.getBlock().getWorld().dropItemNaturally(event.getBlock().getLocation().add(.4, .4, .4),
  55. new ItemStack(idAL.get(number), amountDropped));
  56.  
  57. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement