I am trying to create a custom "Baker" villager type but am having trouble getting it to be created naturally. I am able to summon a baker villager with "/summon minecraft:villager 92.70 63.00 214.65 {Brain: {memories: {"minecraft:job_site": {pos: [I; 91, 63, 214], dimension: "minecraft:overworld"}}}, VillagerData: {profession: "bakecraft:baker"}}", but it converts into an unemployed villager as soon as it turns time hits 2000. I have double-checked and the job site coordinates are correct. I cannot get one to generate naturally by putting it next to the workstation. I know the profession and POI are registered properly because they show up in the registry while debugging. What am I missing? Why aren't the villagers recognizing their workstations? Any help is appreciated. Thanks!
package com.appjackstudio.bakecraft.init;
import com.google.common.collect.ImmutableSet;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.entity.merchant.villager.VillagerProfession;
import net.minecraft.util.SoundEvent;
import net.minecraft.village.PointOfInterestType;
import net.minecraftforge.registries.IForgeRegistry;
import java.util.Set;
public class ModVillagers {
public static Set<BlockState> getAllStates(Block block) {
return ImmutableSet.copyOf(block.getStateContainer().getValidStates());
}
public static final PointOfInterestType OVEN = new PointOfInterestType("oven", getAllStates(ModBlocks.TRONA), 1, (SoundEvent)null, 1).setRegistryName("oven");
public static void registerPointOfIntrestTypes(IForgeRegistry<PointOfInterestType> registry){
registry.registerAll(
OVEN
);
}
public static final VillagerProfession BAKER = new VillagerProfession("baker", OVEN, ImmutableSet.of(), ImmutableSet.of()).setRegistryName("baker");
public static void registerVillagerProfessions(IForgeRegistry<VillagerProfession> registry){
registry.registerAll(
BAKER
);
}
}