--- a/net/minecraft/world/entity/animal/IronGolem.java
+++ b/net/minecraft/world/entity/animal/IronGolem.java
@@ -106,7 +_,7 @@
     @Override
     protected void doPush(Entity entity) {
         if (entity instanceof Enemy && !(entity instanceof Creeper) && this.getRandom().nextInt(20) == 0) {
-            this.setTarget((LivingEntity)entity);
+            this.setTarget((LivingEntity)entity, org.bukkit.event.entity.EntityTargetLivingEntityEvent.TargetReason.COLLISION); // CraftBukkit - set reason
         }
 
         super.doPush(entity);
@@ -305,7 +_,7 @@
         BlockPos blockPos = this.blockPosition();
         BlockPos blockPos1 = blockPos.below();
         BlockState blockState = level.getBlockState(blockPos1);
-        if (!blockState.entityCanStandOn(level, blockPos1, this)) {
+        if (!blockState.entityCanStandOn(level, blockPos1, this) && !this.level().paperConfig().entities.spawning.ironGolemsCanSpawnInAir) { // Paper - Add option to allow iron golems to spawn in air
             return false;
         } else {
             for (int i = 1; i < 3; i++) {
