One No enchantments update...they are added, but they get removed or disappear outside of the .addEnchant part Code: if(fConfig.get(i + ".enchantments.0.name") != null) { for(int j = 0; fConfig.get(i + ".enchantments." + j + ".name") != null; j++) { enchantName = fConfig.getString(i + ".enchantments." + j + ".name"); enchantLevel = fConfig.getInt(i + ".enchantments." + j + ".level"); ench = Enchantment.getByName(enchantName); try{ item.addEnchantment(ench, enchantLevel); } catch (IllegalArgumentException exep){ safe = false; } if(safe){ item.addEnchantment(ench, enchantLevel); } else { item.addUnsafeEnchantment(ench, enchantLevel); } } } Two Anyone have experience coding with McMMO? As many of you that use McMMO know, once you get to a certain level...drop rates can double or triple I have made something to make gold and iron automatically drop...Can anyone tell me how I would link this in with McMMO's fortune to make it sometimes drop more based on your level? Thanks, JHG0 Code For Auto-Drops: Code: @EventHandler (priority = EventPriority.HIGHEST) public void onMine(BlockBreakEvent e){ Player p = e.getPlayer(); if(e.getBlock().getType() == Material.IRON_ORE){ e.setCancelled(true); if(Bukkit.getPluginManager().getPlugin("WorldGuard") != null){ WorldGuardPlugin wg = (WorldGuardPlugin) getServer().getPluginManager().getPlugin("WorldGuard"); if(wg.canBuild(p, e.getBlock().getLocation())){ e.getBlock().setType(Material.AIR); e.getBlock().getWorld().dropItemNaturally(e.getBlock().getLocation(), new ItemStack(Material.IRON_INGOT)); } } } else if(e.getBlock().getType() == Material.GOLD_ORE){ e.setCancelled(true); if(Bukkit.getPluginManager().getPlugin("WorldGuard") != null){ WorldGuardPlugin wg = (WorldGuardPlugin) getServer().getPluginManager().getPlugin("WorldGuard"); if(wg.canBuild(p, e.getBlock().getLocation())){ e.getBlock().setType(Material.AIR); e.getBlock().getWorld().dropItemNaturally(e.getBlock().getLocation(), new ItemStack(Material.GOLD_INGOT)); } } } } Thanks JHG0 Okay, fixed part one a weird way..now need part two help EDIT by Moderator: merged posts, please use the edit button instead of double posting.
JHG0 Use this to get a player's mining level from MCMMO. Code: ExperienceAPI.getLevel(player, "Mining");
JHG0 What are you talking about? The 'right-click ability' for mining? https://github.com/mcMMO-Dev/mcMMO/...mail/nossr50/skills/mining/MiningManager.java Here is the source for the mining. Check Line 78-88
newboyhun There is a thing that if you are mining say diamond. And have level x, you have x% chance of getting two or three diamonds
JHG0 Code: SkillType skill = SkillType.Mining; Player p = e.getPlayer(); ExperienceAPI.getLevel(p, "Mining"); int activationChance = PerkUtils.handleLuckyPerks(p, skill); for (int i = mcMMOPlayer.getAbilityMode(skill.getAbility()) ? 2 : 1; i != 0; i--) { if (SkillUtils.activationSuccessful(SecondaryAbility.MINING_DOUBLE_DROPS, p, lvl, activationChance)) { // DOUBLE DROP" } }