--- a/net/minecraft/world/entity/ai/behavior/AssignProfessionFromJobSite.java
+++ b/net/minecraft/world/entity/ai/behavior/AssignProfessionFromJobSite.java
@@ -2,50 +2,62 @@
 
 import java.util.Optional;
 import net.minecraft.core.GlobalPos;
-import net.minecraft.core.Holder;
 import net.minecraft.core.registries.BuiltInRegistries;
 import net.minecraft.server.MinecraftServer;
 import net.minecraft.world.entity.ai.behavior.declarative.BehaviorBuilder;
 import net.minecraft.world.entity.ai.memory.MemoryModuleType;
-import net.minecraft.world.entity.ai.village.poi.PoiType;
 import net.minecraft.world.entity.npc.Villager;
 import net.minecraft.world.entity.npc.VillagerProfession;
 
+// CraftBukkit start
+import org.bukkit.craftbukkit.entity.CraftVillager;
+import org.bukkit.craftbukkit.event.CraftEventFactory;
+import org.bukkit.event.entity.VillagerCareerChangeEvent;
+// CraftBukkit end
+
 public class AssignProfessionFromJobSite {
+
+    public AssignProfessionFromJobSite() {}
+
     public static BehaviorControl<Villager> create() {
-        return BehaviorBuilder.create(
-            context -> context.group(context.present(MemoryModuleType.POTENTIAL_JOB_SITE), context.registered(MemoryModuleType.JOB_SITE))
-                    .apply(
-                        context,
-                        (potentialJobSite, jobSite) -> (world, entity, time) -> {
-                                GlobalPos globalPos = context.get(potentialJobSite);
-                                if (!globalPos.pos().closerToCenterThan(entity.position(), 2.0) && !entity.assignProfessionWhenSpawned()) {
-                                    return false;
-                                } else {
-                                    potentialJobSite.erase();
-                                    jobSite.set(globalPos);
-                                    world.broadcastEntityEvent(entity, (byte)14);
-                                    if (entity.getVillagerData().getProfession() != VillagerProfession.NONE) {
-                                        return true;
-                                    } else {
-                                        MinecraftServer minecraftServer = world.getServer();
-                                        Optional.ofNullable(minecraftServer.getLevel(globalPos.dimension()))
-                                            .flatMap(jobSiteWorld -> jobSiteWorld.getPoiManager().getType(globalPos.pos()))
-                                            .flatMap(
-                                                poiType -> BuiltInRegistries.VILLAGER_PROFESSION
-                                                        .stream()
-                                                        .filter(profession -> profession.heldJobSite().test((Holder<PoiType>)poiType))
-                                                        .findFirst()
-                                            )
-                                            .ifPresent(profession -> {
-                                                entity.setVillagerData(entity.getVillagerData().setProfession(profession));
-                                                entity.refreshBrain(world);
-                                            });
-                                        return true;
-                                    }
+        return BehaviorBuilder.create((behaviorbuilder_b) -> {
+            return behaviorbuilder_b.group(behaviorbuilder_b.present(MemoryModuleType.POTENTIAL_JOB_SITE), behaviorbuilder_b.registered(MemoryModuleType.JOB_SITE)).apply(behaviorbuilder_b, (memoryaccessor, memoryaccessor1) -> {
+                return (worldserver, entityvillager, i) -> {
+                    GlobalPos globalpos = (GlobalPos) behaviorbuilder_b.get(memoryaccessor);
+
+                    if (!globalpos.pos().closerToCenterThan(entityvillager.position(), 2.0D) && !entityvillager.assignProfessionWhenSpawned()) {
+                        return false;
+                    } else {
+                        memoryaccessor.erase();
+                        memoryaccessor1.set(globalpos);
+                        worldserver.broadcastEntityEvent(entityvillager, (byte) 14);
+                        if (entityvillager.getVillagerData().getProfession() != VillagerProfession.NONE) {
+                            return true;
+                        } else {
+                            MinecraftServer minecraftserver = worldserver.getServer();
+
+                            Optional.ofNullable(minecraftserver.getLevel(globalpos.dimension())).flatMap((worldserver1) -> {
+                                return worldserver1.getPoiManager().getType(globalpos.pos());
+                            }).flatMap((holder) -> {
+                                return BuiltInRegistries.VILLAGER_PROFESSION.stream().filter((villagerprofession) -> {
+                                    return villagerprofession.heldJobSite().test(holder);
+                                }).findFirst();
+                            }).ifPresent((villagerprofession) -> {
+                                // CraftBukkit start - Fire VillagerCareerChangeEvent where Villager gets employed
+                                VillagerCareerChangeEvent event = CraftEventFactory.callVillagerCareerChangeEvent(entityvillager, CraftVillager.CraftProfession.minecraftToBukkit(villagerprofession), VillagerCareerChangeEvent.ChangeReason.EMPLOYED);
+                                if (event.isCancelled()) {
+                                    return;
                                 }
-                            }
-                    )
-        );
+
+                                entityvillager.setVillagerData(entityvillager.getVillagerData().setProfession(CraftVillager.CraftProfession.bukkitToMinecraft(event.getProfession())));
+                                // CraftBukkit end
+                                entityvillager.refreshBrain(worldserver);
+                            });
+                            return true;
+                        }
+                    }
+                };
+            });
+        });
     }
 }
