const food_list = [ '8x minecraft:apple', '8x minecraft:beetroot', '8x minecraft:baked_potato', '8x minecraft:bread', '8x minecraft:carrot', '8x minecraft:melon_slice', '8x minecraft:sweet_berries', '8x farmersdelight:pumpkin_slice', '8x farmersdelight:cabbage_leaf', '8x farmersdelight:tomato', '8x farmersdelight:cooked_rice', '8x farmersdelight:fried_egg', '8x neapolitan:strawberries', '8x neapolitan:banana', '8x neapolitan:dried_banana', '8x neapolitan:roasted_adzuki_beans', '8x neapolitan:mint_candies', '8x atmospheric:passion_fruit', '8x atmospheric:currant', '8x atmospheric:dragon_fruit', '8x atmospheric:candied_orange_slices', '8x atmospheric:roasted_yucca_fruit', ]; const deco_list = [ '32x minecraft:diorite', '32x minecraft:granite', '32x minecraft:andesite', '32x minecraft:stone', '32x minecraft:mossy_cobblestone', '32x minecraft:blackstone', '32x minecraft:tuff', '32x minecraft:dirt', '32x minecraft:gravel', '32x minecraft:mud', '32x minecraft:mud_bricks', '32x minecraft:stone_bricks', '32x minecraft:cobbled_deepslate', '32x supplementaries:daub', '32x supplementaries:daub_frame', '32x clayworks:concrete', ]; const feast_list = [ 'farmersdelight:rice_roll_medley_block', 'farmersdelight:shepherds_pie_block', 'farmersdelight:honey_glazed_ham_block', 'farmersdelight:stuffed_pumpkin_block', 'farmersdelight:roast_chicken_block', 'farmersdelight:pasta_with_meatballs', ]; const enchantment_list = { armorer: ['projectile_protection', 'blast_protection'], butcher: ['sharpness', 'sweeping'], cartographer: ['looting', 'fortune'], cleric: ['fire_aspect', 'fire_protection', 'flame'], farmer: ['efficiency', 'thorns'], fisherman: ['lure', 'luck_of_the_sea'], fletcher: ['power', 'punch', 'quick_charge', 'piercing'], leatherworker: ['feather_falling', 'depth_strider'], librarian: ['smite', 'bane_of_arthropods'], mason: ['protection', 'unbreaking'], shepherd: ['knockback', 'aqua_affinity'], toolsmith: ['silk_touch', 'fortune'], weaponsmith: ['sharpness', 'fire_aspect'], 'chefsdelight:delightchef': ['flame', 'fire_aspect'], 'chefsdelight:delightcook': ['flame', 'fire_aspect'], 'sawmill:carpenter': ['knockback', 'fortune'], } function roll(list, random){ return list[Math.floor(random.next() * list.length)]; } MoreJSEvents.villagerTrades((event) => { return; event.removeVanillaTrades(); event.removeModdedTrades(); const professions = VillagerUtils.getProfessions(); for(const prof of professions){ event.addCustomTrade(prof, 1, (offer, entity, random) => { offer.setFirstInput(roll(food_list, random)); offer.setOutput('emerald'); offer.setMaxUses(1); offer.setVillagerExperience(5); offer.setPriceMultiplier(1); }); event.addCustomTrade(prof, 4, (offer, entity, random) => { offer.setFirstInput('3x emerald'); offer.setOutput(roll(deco_list, random)); offer.setMaxUses(4); offer.setVillagerExperience(1); offer.setPriceMultiplier(1); }); event.addCustomTrade(prof, 4, (offer, entity, random) => { offer.setFirstInput(roll(feast_list, random)); offer.setOutput('5x emerald'); offer.setMaxUses(1); offer.setVillagerExperience(1); offer.setPriceMultiplier(1); }); // for(const enchant of enchantment_list[prof]){ // const trade = VillagerUtils.createEnchantedItemTrade(['6x emerald'], 'minecraft:enchanted_book'); // trade.maxUses(1); // trade.villagerExperience(1); // trade.enchantments(enchant).amount(1); // event.addTrade(prof, 3, trade); // } } });