Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ITEMS ALGORITHM START
- Random rand = new Random();
- int num = rand.nextInt(14);
- ItemStack is = null;
- if (num == 0) { //helmet
- num = rand.nextInt(3);
- if(num == 0) {
- is = new ItemStack(Material.IRON_HELMET,1);
- }else if(num == 1) {
- is = new ItemStack(Material.DIAMOND_HELMET,1);
- }else {
- is = new ItemStack(Material.NETHERITE_HELMET,1);
- }
- num = rand.nextInt(4);
- if(num == 0) {
- is.addEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 1);
- }else if(num == 1) {
- is.addEnchantment(Enchantment.PROTECTION_FIRE, 1);
- }else if(num == 2) {
- is.addEnchantment(Enchantment.DURABILITY, 1);
- }else {
- is.addEnchantment(Enchantment.OXYGEN, 1);
- }
- }else if (num == 1) {//chest
- num = rand.nextInt(3);
- if(num == 0) {
- is = new ItemStack(Material.IRON_CHESTPLATE,1);
- }else if(num == 1) {
- is = new ItemStack(Material.DIAMOND_CHESTPLATE,1);
- }else {
- is = new ItemStack(Material.NETHERITE_CHESTPLATE,1);
- }
- num = rand.nextInt(4);
- if(num == 0) {
- is.addEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 1);
- }else if(num == 1) {
- is.addEnchantment(Enchantment.PROTECTION_FIRE, 1);
- }else if(num == 2) {
- is.addEnchantment(Enchantment.DURABILITY, 1);
- }else {
- is.addEnchantment(Enchantment.THORNS, 1);
- }
- }else if (num == 2) {//pants
- num = rand.nextInt(3);
- if(num == 0) {
- is = new ItemStack(Material.IRON_LEGGINGS,1);
- }else if(num == 1) {
- is = new ItemStack(Material.DIAMOND_LEGGINGS,1);
- }else {
- is = new ItemStack(Material.NETHERITE_LEGGINGS,1);
- }
- num = rand.nextInt(4);
- if(num == 0) {
- is.addEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 1);
- }else if(num == 1) {
- is.addEnchantment(Enchantment.PROTECTION_FIRE, 1);
- }else if(num == 2) {
- is.addEnchantment(Enchantment.DURABILITY, 1);
- }else {
- is.addEnchantment(Enchantment.THORNS, 1);
- }
- }else if (num == 3) {//boots
- num = rand.nextInt(3);
- if(num == 0) {
- is = new ItemStack(Material.IRON_BOOTS,1);
- }else if(num == 1) {
- is = new ItemStack(Material.DIAMOND_BOOTS,1);
- }else {
- is = new ItemStack(Material.NETHERITE_BOOTS,1);
- }
- num = rand.nextInt(8);
- if(num == 0) {
- is.addEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 1);
- }else if(num == 1) {
- is.addEnchantment(Enchantment.PROTECTION_FIRE, 1);
- }else if(num == 2) {
- is.addEnchantment(Enchantment.DURABILITY, 1);
- }else if(num == 3) {
- is.addEnchantment(Enchantment.WATER_WORKER, 1);
- }else if(num == 4) {
- is.addEnchantment(Enchantment.SOUL_SPEED, 1);
- }else if(num == 5) {
- is.addEnchantment(Enchantment.FROST_WALKER, 1);
- }else if(num == 6) {
- is.addEnchantment(Enchantment.DEPTH_STRIDER, 1);
- }else {
- is.addEnchantment(Enchantment.PROTECTION_FALL, 1);
- }
- }else if (num == 4) {//pickaxe
- num = rand.nextInt(3);
- if(num == 0) {
- is = new ItemStack(Material.IRON_PICKAXE,1);
- }else if(num == 1) {
- is = new ItemStack(Material.DIAMOND_PICKAXE,1);
- }else {
- is = new ItemStack(Material.NETHERITE_PICKAXE,1);
- }
- num = rand.nextInt(4);
- if(num == 0) {
- is.addEnchantment(Enchantment.DIG_SPEED, 1);
- }else if(num == 1) {
- is.addEnchantment(Enchantment.SILK_TOUCH, 1);
- }else if(num == 2) {
- is.addEnchantment(Enchantment.DURABILITY, 1);
- }else {
- is.addEnchantment(Enchantment.LOOT_BONUS_BLOCKS, 1);
- }
- }else if (num == 5) {//sword
- num = rand.nextInt(3);
- if(num == 0) {
- is = new ItemStack(Material.IRON_SWORD,1);
- }else if(num == 1) {
- is = new ItemStack(Material.DIAMOND_SWORD,1);
- }else {
- is = new ItemStack(Material.NETHERITE_SWORD,1);
- }
- num = rand.nextInt(4);
- if(num == 0) {
- is.addEnchantment(Enchantment.DAMAGE_ALL, 1);
- }else if(num == 1) {
- is.addEnchantment(Enchantment.FIRE_ASPECT, 1);
- }else if(num == 2) {
- is.addEnchantment(Enchantment.DURABILITY, 1);
- }else {
- is.addEnchantment(Enchantment.MENDING, 1);
- }
- }else if (num == 6) {//shovel
- num = rand.nextInt(3);
- if(num == 0) {
- is = new ItemStack(Material.IRON_SHOVEL,1);
- }else if(num == 1) {
- is = new ItemStack(Material.DIAMOND_SHOVEL,1);
- }else {
- is = new ItemStack(Material.NETHERITE_SHOVEL,1);
- }
- num = rand.nextInt(4);
- if(num == 0) {
- is.addEnchantment(Enchantment.DIG_SPEED, 1);
- }else if(num == 1) {
- is.addEnchantment(Enchantment.SILK_TOUCH, 1);
- }else if(num == 2) {
- is.addEnchantment(Enchantment.DURABILITY, 1);
- }else {
- is.addEnchantment(Enchantment.LOOT_BONUS_BLOCKS, 1);
- }
- }else if (num == 7) {//axe
- num = rand.nextInt(3);
- if(num == 0) {
- is = new ItemStack(Material.IRON_AXE,1);
- }else if(num == 1) {
- is = new ItemStack(Material.DIAMOND_AXE,1);
- }else {
- is = new ItemStack(Material.NETHERITE_AXE,1);
- }
- num = rand.nextInt(4);
- if(num == 0) {
- is.addEnchantment(Enchantment.DAMAGE_ALL, 1);
- }else if(num == 1) {
- is.addEnchantment(Enchantment.FIRE_ASPECT, 1);
- }else if(num == 2) {
- is.addEnchantment(Enchantment.DURABILITY, 1);
- }else {
- is.addEnchantment(Enchantment.MENDING, 1);
- }
- }else if (num == 8) {//shield
- is = new ItemStack(Material.SHIELD,1);
- }else if (num == 9) {//totem
- is = new ItemStack(Material.TOTEM_OF_UNDYING,1);
- }else if (num == 10) {//diamond
- is = new ItemStack(Material.DIAMOND,2);
- }else if (num == 11) {//iron
- is = new ItemStack(Material.IRON_INGOT,10);
- }else if (num == 12) {//gold
- is = new ItemStack(Material.GOLD_INGOT,10);
- }else { //golden apple
- is = new ItemStack(Material.ENCHANTED_GOLDEN_APPLE,1);
- }
- // ITEMS ALGORITHM END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement