Hello there! We are conducting a survey to better understand the user experience in making a first edit. If you have ever made an edit on Gamepedia, please fill out the survey. Thank you!

Talk:Hero of the Village

From Minecraft Wiki
Jump to: navigation, search

Baby + Unemployed gifts[edit]

I can't find anything in the loot table files about either of these villager types getting gifts. Where is this information from? -PancakeIdentity (talk) 03:16, 21 May 2019 (UTC)

Those are hardcoded, and the info came from in-game testing. FVbico (talk) 05:14, 21 May 2019 (UTC)
They are available at minecraft:gameplay/hero_of_the_village/<profession-name>_gift loot tables in java edition. liach (talk) 06:11, 21 May 2019 (UTC)
Not for unemployeed ones. FVbico (talk) 06:20, 21 May 2019 (UTC)
In fact, the code is like this: (yarn deobfuscated, 1.14.1 Pre-2)
    private List<ItemStack> getGifts(VillagerEntity class_1646_1) {
        if (class_1646_1.isBaby()) {
            return ImmutableList.of((Object)new ItemStack(Items.POPPY));
        }
        VillagerProfession class_3852_1 = class_1646_1.getVillagerData().getProfession();
        if (GIFTS.containsKey(class_3852_1)) {
            LootSupplier class_52_1 = class_1646_1.world.getServer().getLootManager().getSupplier(GIFTS.get(class_3852_1));
            LootContext.Builder class_47$class_48_1 = new LootContext.Builder((ServerWorld)class_1646_1.world).put(LootContextParameters.POSITION, new BlockPos(class_1646_1)).put(LootContextParameters.THIS_ENTITY, class_1646_1).setRandom(class_1646_1.getRand());
            return class_52_1.getDrops(class_47$class_48_1.build(LootContextTypes.GIFT));
        }
        return ImmutableList.of((Object)new ItemStack(Items.WHEAT_SEEDS));
    }
So the wheat seeds and poppy are hardcoded while the rest are queried from loot tables. Should be clear enough now. liach (talk) 09:18, 21 May 2019 (UTC)