--- a/net/minecraft/world/entity/ai/behavior/ResetProfession.java
+++ b/net/minecraft/world/entity/ai/behavior/ResetProfession.java
@@ -6,15 +6,32 @@
 import net.minecraft.world.entity.npc.VillagerData;
 import net.minecraft.world.entity.npc.VillagerProfession;
 
+// CraftBukkit start
+import org.bukkit.craftbukkit.v1_20_R2.entity.CraftVillager;
+import org.bukkit.craftbukkit.v1_20_R2.event.CraftEventFactory;
+import org.bukkit.event.entity.VillagerCareerChangeEvent;
+// CraftBukkit end
+
 public class ResetProfession {
+
+    public ResetProfession() {}
+
     public static BehaviorControl<Villager> create() {
-        return BehaviorBuilder.create((context) -> {
-            return context.group(context.absent(MemoryModuleType.JOB_SITE)).apply(context, (jobSite) -> {
-                return (world, entity, time) -> {
-                    VillagerData villagerData = entity.getVillagerData();
-                    if (villagerData.getProfession() != VillagerProfession.NONE && villagerData.getProfession() != VillagerProfession.NITWIT && entity.getVillagerXp() == 0 && villagerData.getLevel() <= 1) {
-                        entity.setVillagerData(entity.getVillagerData().setProfession(VillagerProfession.NONE));
-                        entity.refreshBrain(world);
+        return BehaviorBuilder.create((behaviorbuilder_b) -> {
+            return behaviorbuilder_b.group(behaviorbuilder_b.absent(MemoryModuleType.JOB_SITE)).apply(behaviorbuilder_b, (memoryaccessor) -> {
+                return (worldserver, entityvillager, i) -> {
+                    VillagerData villagerdata = entityvillager.getVillagerData();
+
+                    if (villagerdata.getProfession() != VillagerProfession.NONE && villagerdata.getProfession() != VillagerProfession.NITWIT && entityvillager.getVillagerXp() == 0 && villagerdata.getLevel() <= 1) {
+                        // CraftBukkit start
+                        VillagerCareerChangeEvent event = CraftEventFactory.callVillagerCareerChangeEvent(entityvillager, CraftVillager.CraftProfession.minecraftToBukkit(VillagerProfession.NONE), VillagerCareerChangeEvent.ChangeReason.LOSING_JOB);
+                        if (event.isCancelled()) {
+                            return false;
+                        }
+
+                        entityvillager.setVillagerData(entityvillager.getVillagerData().setProfession(CraftVillager.CraftProfession.bukkitToMinecraft(event.getProfession())));
+                        // CraftBukkit end
+                        entityvillager.refreshBrain(worldserver);
                         return true;
                     } else {
                         return false;
