|
|
|
@ -1,4 +1,5 @@
|
|
|
|
const { $RandomSource } = require("packages/net/minecraft/util/$RandomSource");
|
|
|
|
const { $RandomSource } = require("packages/net/minecraft/util/$RandomSource");
|
|
|
|
|
|
|
|
const { $Villager } = require("packages/net/minecraft/world/entity/npc/$Villager");
|
|
|
|
|
|
|
|
|
|
|
|
// level 5 just eat feast for 5 emeralds
|
|
|
|
// level 5 just eat feast for 5 emeralds
|
|
|
|
const feast_list = [
|
|
|
|
const feast_list = [
|
|
|
|
@ -8,6 +9,11 @@ const feast_list = [
|
|
|
|
'farmersdelight:stuffed_pumpkin_block',
|
|
|
|
'farmersdelight:stuffed_pumpkin_block',
|
|
|
|
'farmersdelight:roast_chicken_block',
|
|
|
|
'farmersdelight:roast_chicken_block',
|
|
|
|
'farmersdelight:pasta_with_meatballs',
|
|
|
|
'farmersdelight:pasta_with_meatballs',
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
'abnormals_delight:perch_with_mushrooms',
|
|
|
|
|
|
|
|
'abnormals_delight:pike_with_beetroot',
|
|
|
|
|
|
|
|
'abnormals_delight:vension_with_bamboo_shoots',
|
|
|
|
|
|
|
|
'abnormals_delight:passion_fruit_glazed_duck',
|
|
|
|
];
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|
|
// level 4 helps you with block collection
|
|
|
|
// level 4 helps you with block collection
|
|
|
|
@ -69,7 +75,7 @@ const consumables = {
|
|
|
|
fisherman: ['2x aquaculture:fish_bones', '3x aquaculture:leech', '5x aquaculture:worm', '8x aquaculture:box',
|
|
|
|
fisherman: ['2x aquaculture:fish_bones', '3x aquaculture:leech', '5x aquaculture:worm', '8x aquaculture:box',
|
|
|
|
'5x aquaculture:lockbox', '2x aquaculture:treasure_chest'],
|
|
|
|
'5x aquaculture:lockbox', '2x aquaculture:treasure_chest'],
|
|
|
|
// various potion arrows, bows, crossbows
|
|
|
|
// various potion arrows, bows, crossbows
|
|
|
|
fletcher: ['bow', 'bow', 'bow', 'crossbow', 'crowssbow'],
|
|
|
|
fletcher: ['8x arrow', '4x caverns_and_chasms:large_arrow', '16x caverns_and_chasms:blunt_arrow', '8x savage_and_ravages:mischief_arrow'],
|
|
|
|
// leather armor, bedrolls
|
|
|
|
// leather armor, bedrolls
|
|
|
|
leatherworker: ['leather_helmet', 'leather_chestplate', 'leather_leggings', 'leather_boots'],
|
|
|
|
leatherworker: ['leather_helmet', 'leather_chestplate', 'leather_leggings', 'leather_boots'],
|
|
|
|
// various dyes
|
|
|
|
// various dyes
|
|
|
|
@ -82,21 +88,19 @@ const consumables = {
|
|
|
|
// wool, eggs, milk, honey, slime ball
|
|
|
|
// wool, eggs, milk, honey, slime ball
|
|
|
|
shepherd: ['3x white_wool', '8x environmental:duck_egg', '8x autumnity:turkey_egg', '4x environmental:yak_hair'],
|
|
|
|
shepherd: ['3x white_wool', '8x environmental:duck_egg', '8x autumnity:turkey_egg', '4x environmental:yak_hair'],
|
|
|
|
// shovel, pick
|
|
|
|
// shovel, pick
|
|
|
|
toolsmith: ['iron_shovel', 'iron_pickaxe', 'golden_shovel', 'golden_pickaxe'],
|
|
|
|
toolsmith: ['iron_shovel', 'iron_pickaxe', 'iron_hoe', 'golden_shovel', 'golden_pickaxe', 'golden_hoe'],
|
|
|
|
// sword, axe
|
|
|
|
// sword, axe
|
|
|
|
weaponsmith: ['iron_sword', 'iron_axe', 'golden_sword', 'golden_axe'],
|
|
|
|
weaponsmith: ['iron_sword', 'iron_axe', 'golden_sword', 'golden_axe', 'bow', 'crossbow'],
|
|
|
|
// rice, spaghetti, dough, crust
|
|
|
|
// rice, spaghetti, dough, crust
|
|
|
|
delightchef: ['8x farmersdelight:rice', '10x farmersdelight:raw_pasta', '10x farmersdelight:crust', '16x sugar'],
|
|
|
|
delightchef: ['8x farmersdelight:rice', '10x farmersdelight:raw_pasta', '10x farmersdelight:crust', '16x sugar'],
|
|
|
|
// cut raw meat
|
|
|
|
// cut raw meat
|
|
|
|
delightcook: ['16x bowl', '16x glass_bottle', '1x bucket', '8x farmersdelight:minced_beef', '8x farmersdelight:bacon'],
|
|
|
|
delightcook: ['16x bowl', '16x glass_bottle', '1x bucket', '8x farmersdelight:minced_beef', '8x farmersdelight:bacon'],
|
|
|
|
// planks
|
|
|
|
// planks
|
|
|
|
carpenter: ['32x oak_planks', '32x spruce_planks', '32x birch_planks', '32x jungle_planks', '32x pine_planks', '32x bamboo_planks',
|
|
|
|
carpenter: [],
|
|
|
|
'32x cherry_planks'],
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
const enchant_consumables = {
|
|
|
|
const enchant_consumables = {
|
|
|
|
armorer: 1,
|
|
|
|
armorer: 1,
|
|
|
|
fletcher: 1,
|
|
|
|
|
|
|
|
leatherworker: 2,
|
|
|
|
leatherworker: 2,
|
|
|
|
toolsmith: 3,
|
|
|
|
toolsmith: 3,
|
|
|
|
weaponsmith: 2
|
|
|
|
weaponsmith: 2
|
|
|
|
@ -106,17 +110,13 @@ const enchant_consumables = {
|
|
|
|
const food_list = [
|
|
|
|
const food_list = [
|
|
|
|
'8x minecraft:apple',
|
|
|
|
'8x minecraft:apple',
|
|
|
|
'8x minecraft:beetroot',
|
|
|
|
'8x minecraft:beetroot',
|
|
|
|
'8x minecraft:baked_potato',
|
|
|
|
|
|
|
|
'8x minecraft:bread',
|
|
|
|
|
|
|
|
'8x minecraft:carrot',
|
|
|
|
|
|
|
|
'8x minecraft:melon_slice',
|
|
|
|
'8x minecraft:melon_slice',
|
|
|
|
'8x minecraft:sweet_berries',
|
|
|
|
'8x minecraft:sweet_berries',
|
|
|
|
|
|
|
|
|
|
|
|
'8x farmersdelight:pumpkin_slice',
|
|
|
|
|
|
|
|
'8x farmersdelight:cabbage_leaf',
|
|
|
|
'8x farmersdelight:cabbage_leaf',
|
|
|
|
'8x farmersdelight:tomato',
|
|
|
|
'8x farmersdelight:tomato',
|
|
|
|
'8x farmersdelight:cooked_rice',
|
|
|
|
|
|
|
|
'8x farmersdelight:fried_egg',
|
|
|
|
'8x farmersdelight:fried_egg',
|
|
|
|
|
|
|
|
'8x farmersdelight:onion',
|
|
|
|
|
|
|
|
|
|
|
|
'8x neapolitan:strawberries',
|
|
|
|
'8x neapolitan:strawberries',
|
|
|
|
'8x neapolitan:banana',
|
|
|
|
'8x neapolitan:banana',
|
|
|
|
@ -129,8 +129,29 @@ const food_list = [
|
|
|
|
'8x atmospheric:dragon_fruit',
|
|
|
|
'8x atmospheric:dragon_fruit',
|
|
|
|
'8x atmospheric:candied_orange_slices',
|
|
|
|
'8x atmospheric:candied_orange_slices',
|
|
|
|
'8x atmospheric:roasted_yucca_fruit',
|
|
|
|
'8x atmospheric:roasted_yucca_fruit',
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
'brewinandchewin:beer',
|
|
|
|
|
|
|
|
'brewinandchewin:vodka',
|
|
|
|
|
|
|
|
'brewinandchewin:mead',
|
|
|
|
|
|
|
|
'brewinandchewin:rice_wine',
|
|
|
|
|
|
|
|
'brewinandchewin:pale_jane',
|
|
|
|
|
|
|
|
'brewinandchewin:egg_grog',
|
|
|
|
|
|
|
|
'brewinandchewin:bloody_mary',
|
|
|
|
|
|
|
|
'brewinandchewin:salty_folly',
|
|
|
|
|
|
|
|
'brewinandchewin:saccharine_rum',
|
|
|
|
];
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const main_diet = {
|
|
|
|
|
|
|
|
'minecraft:desert': '8x #forge:milk',
|
|
|
|
|
|
|
|
'minecraft:plains': '8x bread',
|
|
|
|
|
|
|
|
'minecraft:savanna': '8x carrot',
|
|
|
|
|
|
|
|
'minecraft:snowy': '8x pumpkin_slice',
|
|
|
|
|
|
|
|
'minecraft:taiga': '8x baked_potato',
|
|
|
|
|
|
|
|
'minecraft:jungle': '8x farmersdelight:cooked_rice',
|
|
|
|
|
|
|
|
'minecraft:swamp': '8x mushroom_stew',
|
|
|
|
|
|
|
|
'atmospheric:scrubland': '8x atmospheric:dragon_fruit',
|
|
|
|
|
|
|
|
default: '8x bread'
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @param {string[]} list
|
|
|
|
* @param {string[]} list
|
|
|
|
@ -221,6 +242,28 @@ const village_structures = {
|
|
|
|
'mmv:village_swamp': 1,
|
|
|
|
'mmv:village_swamp': 1,
|
|
|
|
"atmospheric:village_scrubland" : 1
|
|
|
|
"atmospheric:village_scrubland" : 1
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
const village_logs = {
|
|
|
|
|
|
|
|
'minecraft:desert': 'minecraft:cactus',
|
|
|
|
|
|
|
|
'minecraft:plains': 'minecraft:oak_log',
|
|
|
|
|
|
|
|
'minecraft:savanna': 'minecraft:acacia_log',
|
|
|
|
|
|
|
|
'minecraft:snowy': 'minecraft:spruce_log',
|
|
|
|
|
|
|
|
'minecraft:taiga': 'minecraft:birch_log',
|
|
|
|
|
|
|
|
'minecraft:jungle': 'minecraft:jungle_log',
|
|
|
|
|
|
|
|
'minecraft:swamp': 'minecraft:dark_oak_log',
|
|
|
|
|
|
|
|
'atmospheric:scrubland': 'atmospheric:yucca_log'
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
// various saplings
|
|
|
|
|
|
|
|
const carpenter_trades = [
|
|
|
|
|
|
|
|
'minecraft:oak_sapling',
|
|
|
|
|
|
|
|
'minecraft:spruce_sapling',
|
|
|
|
|
|
|
|
'minecraft:birch_sapling',
|
|
|
|
|
|
|
|
'minecraft:acacia_sapling',
|
|
|
|
|
|
|
|
'minecraft:jungle_sapling',
|
|
|
|
|
|
|
|
'minecraft:dark_oak_sapling',
|
|
|
|
|
|
|
|
'minecraft:mangrove_sapling',
|
|
|
|
|
|
|
|
'minecraft:cherry_sapling',
|
|
|
|
|
|
|
|
'minecraft:azalea_sapling',
|
|
|
|
|
|
|
|
];
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @param {Record<string, number>} map
|
|
|
|
* @param {Record<string, number>} map
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@ -236,6 +279,7 @@ MoreJSEvents.villagerTrades((event) => {
|
|
|
|
event.removeVanillaTrades();
|
|
|
|
event.removeVanillaTrades();
|
|
|
|
event.removeModdedTrades();
|
|
|
|
event.removeModdedTrades();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// cartographers: explorer maps
|
|
|
|
const villages = make_weighted_list(village_structures)
|
|
|
|
const villages = make_weighted_list(village_structures)
|
|
|
|
const villageTrade = VillagerUtils.createStructureMapTrade(['2x emerald', 'map'], villages);
|
|
|
|
const villageTrade = VillagerUtils.createStructureMapTrade(['2x emerald', 'map'], villages);
|
|
|
|
villageTrade.maxUses(1);
|
|
|
|
villageTrade.maxUses(1);
|
|
|
|
@ -251,6 +295,28 @@ MoreJSEvents.villagerTrades((event) => {
|
|
|
|
progressionTrade.maxUses(1);
|
|
|
|
progressionTrade.maxUses(1);
|
|
|
|
event.addTrade('cartographer', 2, progressionTrade);
|
|
|
|
event.addTrade('cartographer', 2, progressionTrade);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// carpenters: logs, saplings, planks, tree barks
|
|
|
|
|
|
|
|
event.addCustomTrade('sawmill:carpenter', 2, (offer, entity, random) => {
|
|
|
|
|
|
|
|
/** @type {$Villager} */
|
|
|
|
|
|
|
|
const villager = entity;
|
|
|
|
|
|
|
|
const villagerData = villager.getVillagerData();
|
|
|
|
|
|
|
|
const biome = villagerData.getType().toString();
|
|
|
|
|
|
|
|
const log = village_logs[biome] || 'minecraft:oak_log';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
offer.setFirstInput('2x emerald');
|
|
|
|
|
|
|
|
offer.setOutput('16x ' + log);
|
|
|
|
|
|
|
|
offer.setMaxUses(1);
|
|
|
|
|
|
|
|
offer.setVillagerExperience(1);
|
|
|
|
|
|
|
|
offer.setPriceMultiplier(0.05);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
event.addCustomTrade('sawmill:carpenter', 2, (offer, entity, random) => {
|
|
|
|
|
|
|
|
offer.setFirstInput('2x emerald');
|
|
|
|
|
|
|
|
offer.setOutput(roll(carpenter_trades, random));
|
|
|
|
|
|
|
|
offer.setMaxUses(1);
|
|
|
|
|
|
|
|
offer.setVillagerExperience(1);
|
|
|
|
|
|
|
|
offer.setPriceMultiplier(0.05);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
const professions = VillagerUtils.getProfessions();
|
|
|
|
const professions = VillagerUtils.getProfessions();
|
|
|
|
professions.forEach(prof => {
|
|
|
|
professions.forEach(prof => {
|
|
|
|
const profName = prof.name();
|
|
|
|
const profName = prof.name();
|
|
|
|
@ -268,6 +334,27 @@ MoreJSEvents.villagerTrades((event) => {
|
|
|
|
offer.setVillagerExperience(1);
|
|
|
|
offer.setVillagerExperience(1);
|
|
|
|
offer.setPriceMultiplier(0.2);
|
|
|
|
offer.setPriceMultiplier(0.2);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
// 1 level 1 trade
|
|
|
|
|
|
|
|
event.addCustomTrade(prof, 1, (offer, entity, random) => {
|
|
|
|
|
|
|
|
offer.setFirstInput(roll(food_list, random));
|
|
|
|
|
|
|
|
offer.setOutput('1x emerald');
|
|
|
|
|
|
|
|
offer.setMaxUses(1);
|
|
|
|
|
|
|
|
offer.setVillagerExperience(5);
|
|
|
|
|
|
|
|
offer.setPriceMultiplier(0.05);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
// 1 diet trade
|
|
|
|
|
|
|
|
event.addCustomTrade(prof, 1, (offer, entity, random) => {
|
|
|
|
|
|
|
|
/** @type {$Villager} */
|
|
|
|
|
|
|
|
const villager = entity;
|
|
|
|
|
|
|
|
const villagerData = villager.getVillagerData();
|
|
|
|
|
|
|
|
const biome = villagerData.getType().toString();
|
|
|
|
|
|
|
|
const diet = main_diet[biome] || main_diet.default;
|
|
|
|
|
|
|
|
offer.setFirstInput(diet);
|
|
|
|
|
|
|
|
offer.setOutput('1x emerald');
|
|
|
|
|
|
|
|
offer.setMaxUses(1);
|
|
|
|
|
|
|
|
offer.setVillagerExperience(5);
|
|
|
|
|
|
|
|
offer.setPriceMultiplier(0.05);
|
|
|
|
|
|
|
|
});
|
|
|
|
// 2 for the rest
|
|
|
|
// 2 for the rest
|
|
|
|
for(let i = 0; i < 2; i ++) {
|
|
|
|
for(let i = 0; i < 2; i ++) {
|
|
|
|
// level 4
|
|
|
|
// level 4
|
|
|
|
@ -297,14 +384,6 @@ MoreJSEvents.villagerTrades((event) => {
|
|
|
|
offer.setVillagerExperience(1);
|
|
|
|
offer.setVillagerExperience(1);
|
|
|
|
offer.setPriceMultiplier(0.05);
|
|
|
|
offer.setPriceMultiplier(0.05);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
// level 1
|
|
|
|
|
|
|
|
event.addCustomTrade(prof, 1, (offer, entity, random) => {
|
|
|
|
|
|
|
|
offer.setFirstInput(roll(food_list, random));
|
|
|
|
|
|
|
|
offer.setOutput('1x emerald');
|
|
|
|
|
|
|
|
offer.setMaxUses(1);
|
|
|
|
|
|
|
|
offer.setVillagerExperience(5);
|
|
|
|
|
|
|
|
offer.setPriceMultiplier(0.05);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|