--- a/net/minecraft/world/entity/ai/behavior/BehaviorFarm.java
+++ b/net/minecraft/world/entity/ai/behavior/BehaviorFarm.java
@@ -26,6 +26,11 @@
 import net.minecraft.world.level.block.state.IBlockData;
 import net.minecraft.world.level.gameevent.GameEvent;
 
+// CraftBukkit start
+import net.minecraft.world.level.block.Blocks;
+import org.bukkit.craftbukkit.event.CraftEventFactory;
+// CraftBukkit end
+
 public class BehaviorFarm extends Behavior<EntityVillager> {
 
     private static final int HARVEST_DURATION = 200;
@@ -81,8 +86,8 @@
 
     protected void start(WorldServer worldserver, EntityVillager entityvillager, long i) {
         if (i > this.nextOkStartTime && this.aboveFarmlandPos != null) {
-            entityvillager.getBrain().setMemory(MemoryModuleType.LOOK_TARGET, (Object) (new BehaviorTarget(this.aboveFarmlandPos)));
-            entityvillager.getBrain().setMemory(MemoryModuleType.WALK_TARGET, (Object) (new MemoryTarget(new BehaviorTarget(this.aboveFarmlandPos), 0.5F, 1)));
+            entityvillager.getBrain().setMemory(MemoryModuleType.LOOK_TARGET, (new BehaviorTarget(this.aboveFarmlandPos))); // CraftBukkit - decompile error
+            entityvillager.getBrain().setMemory(MemoryModuleType.WALK_TARGET, (new MemoryTarget(new BehaviorTarget(this.aboveFarmlandPos), 0.5F, 1))); // CraftBukkit - decompile error
         }
 
     }
@@ -102,7 +107,9 @@
                 Block block1 = worldserver.getBlockState(this.aboveFarmlandPos.below()).getBlock();
 
                 if (block instanceof BlockCrops && ((BlockCrops) block).isMaxAge(iblockdata)) {
+                    if (CraftEventFactory.callEntityChangeBlockEvent(entityvillager, this.aboveFarmlandPos, Blocks.AIR.defaultBlockState())) { // CraftBukkit
                     worldserver.destroyBlock(this.aboveFarmlandPos, true, entityvillager);
+                    } // CraftBukkit
                 }
 
                 if (iblockdata.isAir() && block1 instanceof BlockSoil && entityvillager.hasFarmSeeds()) {
@@ -119,9 +126,11 @@
                                 ItemBlock itemblock = (ItemBlock) item;
                                 IBlockData iblockdata1 = itemblock.getBlock().defaultBlockState();
 
+                                if (CraftEventFactory.callEntityChangeBlockEvent(entityvillager, this.aboveFarmlandPos, iblockdata1)) { // CraftBukkit
                                 worldserver.setBlockAndUpdate(this.aboveFarmlandPos, iblockdata1);
                                 worldserver.gameEvent(GameEvent.BLOCK_PLACE, this.aboveFarmlandPos, GameEvent.a.of(entityvillager, iblockdata1));
                                 flag = true;
+                                } // CraftBukkit
                             }
                         }
 
@@ -141,8 +150,8 @@
                     this.aboveFarmlandPos = this.getValidFarmland(worldserver);
                     if (this.aboveFarmlandPos != null) {
                         this.nextOkStartTime = i + 20L;
-                        entityvillager.getBrain().setMemory(MemoryModuleType.WALK_TARGET, (Object) (new MemoryTarget(new BehaviorTarget(this.aboveFarmlandPos), 0.5F, 1)));
-                        entityvillager.getBrain().setMemory(MemoryModuleType.LOOK_TARGET, (Object) (new BehaviorTarget(this.aboveFarmlandPos)));
+                        entityvillager.getBrain().setMemory(MemoryModuleType.WALK_TARGET, (new MemoryTarget(new BehaviorTarget(this.aboveFarmlandPos), 0.5F, 1))); // CraftBukkit - decompile error
+                        entityvillager.getBrain().setMemory(MemoryModuleType.LOOK_TARGET, (new BehaviorTarget(this.aboveFarmlandPos))); // CraftBukkit - decompile error
                     }
                 }
             }
