I am making a plugin that will add random enchantments to the item in your hand when you right click a sign. I have gotten the plugin to work but at the moment i can only add 1 enchantment when you right click the sign. This plugin basically just makes a sign act as a enchantment table for a op server. Currently this is how i am enchanting the item: Code:java int swordench = r.nextInt(15) +1; int enchlev = r.nextInt(30) +1; if(e.getAction() == Action.RIGHT_CLICK_BLOCK){ if(e.getClickedBlock().getType() == Material.WALL_SIGN) { Sign sign = (Sign) b.getState(); if(sign.getLine(0).equalsIgnoreCase("[DazeEnchant]") && sign.getLine(1).equalsIgnoreCase("Sword")){ if(player.getInventory().getItemInHand().getType().equals(Material.DIAMOND_SWORD)){ if(player.getInventory().getItemInHand().getEnchantments().size() == 0) { ItemMeta im = player.getItemInHand().getItemMeta(); if(swordench == 1){ im.addEnchant(Enchantment.DAMAGE_ALL, enchlev, true); player.getItemInHand().setItemMeta(im); }else if(swordench == 2){ im.addEnchant(Enchantment.KNOCKBACK, enchlev, true); player.getItemInHand().setItemMeta(im); }else if(swordench == 3){ im.addEnchant(Enchantment.FIRE_ASPECT, enchlev, true); player.getItemInHand().setItemMeta(im); }else if(swordench == 4){ im.addEnchant(Enchantment.DAMAGE_ARTHROPODS, enchlev, true); player.getItemInHand().setItemMeta(im); }else if(swordench == 5){ im.addEnchant(Enchantment.DAMAGE_UNDEAD, enchlev, true); player.getItemInHand().setItemMeta(im); }else if(swordench == 6){ im.addEnchant(Enchantment.LOOT_BONUS_MOBS, enchlev, true); player.getItemInHand().setItemMeta(im); }else if(swordench == 7){ im.addEnchant(Enchantment.KNOCKBACK, enchlev, true); player.getItemInHand().setItemMeta(im); } I need a more effective way of choosing the random enchantment but i dont know how to do this. I want a way of randomizing how many lines of enchantments will be put on the item too.