--- a/net/minecraft/world/entity/animal/Rabbit.java
+++ b/net/minecraft/world/entity/animal/Rabbit.java
@@ -66,8 +66,12 @@
 import net.minecraft.world.level.gameevent.GameEvent;
 import net.minecraft.world.level.pathfinder.Path;
 import net.minecraft.world.phys.Vec3;
+// CraftBukkit start
+import org.bukkit.craftbukkit.v1_20_R2.event.CraftEventFactory;
+// CraftBukkit end
 
 public class Rabbit extends Animal implements VariantHolder<Rabbit.Variant> {
+
     public static final double STROLL_SPEED_MOD = 0.6D;
     public static final double BREED_SPEED_MOD = 0.8D;
     public static final double FOLLOW_SPEED_MOD = 1.0D;
@@ -88,7 +92,6 @@
         super(type, world);
         this.jumpControl = new Rabbit.RabbitJumpControl(this);
         this.moveControl = new Rabbit.RabbitMoveControl(this);
-        this.setSpeedModifier(0.0D);
     }
 
     @Override
@@ -109,14 +112,17 @@
     @Override
     protected float getJumpPower() {
         float f = 0.3F;
+
         if (this.horizontalCollision || this.moveControl.hasWanted() && this.moveControl.getWantedY() > this.getY() + 0.5D) {
             f = 0.5F;
         }
 
-        Path path = this.navigation.getPath();
-        if (path != null && !path.isDone()) {
-            Vec3 vec3 = path.getNextEntityPos(this);
-            if (vec3.y > this.getY() + 0.5D) {
+        Path pathentity = this.navigation.getPath();
+
+        if (pathentity != null && !pathentity.isDone()) {
+            Vec3 vec3d = pathentity.getNextEntityPos(this);
+
+            if (vec3d.y > this.getY() + 0.5D) {
                 f = 0.5F;
             }
         }
@@ -131,22 +137,24 @@
     @Override
     protected void jumpFromGround() {
         super.jumpFromGround();
-        double d = this.moveControl.getSpeedModifier();
-        if (d > 0.0D) {
-            double e = this.getDeltaMovement().horizontalDistanceSqr();
-            if (e < 0.01D) {
+        double d0 = this.moveControl.getSpeedModifier();
+
+        if (d0 > 0.0D) {
+            double d1 = this.getDeltaMovement().horizontalDistanceSqr();
+
+            if (d1 < 0.01D) {
                 this.moveRelative(0.1F, new Vec3(0.0D, 0.0D, 1.0D));
             }
         }
 
         if (!this.level().isClientSide) {
-            this.level().broadcastEntityEvent(this, (byte)1);
+            this.level().broadcastEntityEvent(this, (byte) 1);
         }
 
     }
 
     public float getJumpCompletion(float delta) {
-        return this.jumpDuration == 0 ? 0.0F : ((float)this.jumpTicks + delta) / (float)this.jumpDuration;
+        return this.jumpDuration == 0 ? 0.0F : ((float) this.jumpTicks + delta) / (float) this.jumpDuration;
     }
 
     public void setSpeedModifier(double speed) {
@@ -172,7 +180,7 @@
     @Override
     protected void defineSynchedData() {
         super.defineSynchedData();
-        this.entityData.define(DATA_TYPE_ID, Rabbit.Variant.BROWN.id);
+        this.entityData.define(Rabbit.DATA_TYPE_ID, Rabbit.Variant.BROWN.id);
     }
 
     @Override
@@ -195,28 +203,31 @@
             }
 
             if (this.getVariant() == Rabbit.Variant.EVIL && this.jumpDelayTicks == 0) {
-                LivingEntity livingEntity = this.getTarget();
-                if (livingEntity != null && this.distanceToSqr(livingEntity) < 16.0D) {
-                    this.facePoint(livingEntity.getX(), livingEntity.getZ());
-                    this.moveControl.setWantedPosition(livingEntity.getX(), livingEntity.getY(), livingEntity.getZ(), this.moveControl.getSpeedModifier());
+                LivingEntity entityliving = this.getTarget();
+
+                if (entityliving != null && this.distanceToSqr((Entity) entityliving) < 16.0D) {
+                    this.facePoint(entityliving.getX(), entityliving.getZ());
+                    this.moveControl.setWantedPosition(entityliving.getX(), entityliving.getY(), entityliving.getZ(), this.moveControl.getSpeedModifier());
                     this.startJumping();
                     this.wasOnGround = true;
                 }
             }
 
-            Rabbit.RabbitJumpControl rabbitJumpControl = (Rabbit.RabbitJumpControl)this.jumpControl;
-            if (!rabbitJumpControl.wantJump()) {
+            Rabbit.RabbitJumpControl entityrabbit_controllerjumprabbit = (Rabbit.RabbitJumpControl) this.jumpControl;
+
+            if (!entityrabbit_controllerjumprabbit.wantJump()) {
                 if (this.moveControl.hasWanted() && this.jumpDelayTicks == 0) {
-                    Path path = this.navigation.getPath();
-                    Vec3 vec3 = new Vec3(this.moveControl.getWantedX(), this.moveControl.getWantedY(), this.moveControl.getWantedZ());
-                    if (path != null && !path.isDone()) {
-                        vec3 = path.getNextEntityPos(this);
+                    Path pathentity = this.navigation.getPath();
+                    Vec3 vec3d = new Vec3(this.moveControl.getWantedX(), this.moveControl.getWantedY(), this.moveControl.getWantedZ());
+
+                    if (pathentity != null && !pathentity.isDone()) {
+                        vec3d = pathentity.getNextEntityPos(this);
                     }
 
-                    this.facePoint(vec3.x, vec3.z);
+                    this.facePoint(vec3d.x, vec3d.z);
                     this.startJumping();
                 }
-            } else if (!rabbitJumpControl.canJump()) {
+            } else if (!entityrabbit_controllerjumprabbit.canJump()) {
                 this.enableJumpControl();
             }
         }
@@ -230,15 +241,15 @@
     }
 
     private void facePoint(double x, double z) {
-        this.setYRot((float)(Mth.atan2(z - this.getZ(), x - this.getX()) * (double)(180F / (float)Math.PI)) - 90.0F);
+        this.setYRot((float) (Mth.atan2(z - this.getZ(), x - this.getX()) * 57.2957763671875D) - 90.0F);
     }
 
     private void enableJumpControl() {
-        ((Rabbit.RabbitJumpControl)this.jumpControl).setCanJump(true);
+        ((Rabbit.RabbitJumpControl) this.jumpControl).setCanJump(true);
     }
 
     private void disableJumpControl() {
-        ((Rabbit.RabbitJumpControl)this.jumpControl).setCanJump(false);
+        ((Rabbit.RabbitJumpControl) this.jumpControl).setCanJump(false);
     }
 
     private void setLandingDelay() {
@@ -269,7 +280,7 @@
     }
 
     public static AttributeSupplier.Builder createAttributes() {
-        return Mob.createMobAttributes().add(Attributes.MAX_HEALTH, 3.0D).add(Attributes.MOVEMENT_SPEED, (double)0.3F);
+        return Mob.createMobAttributes().add(Attributes.MAX_HEALTH, 3.0D).add(Attributes.MOVEMENT_SPEED, 0.30000001192092896D);
     }
 
     @Override
@@ -326,80 +337,79 @@
 
     @Nullable
     @Override
-    public Rabbit getBreedOffspring(ServerLevel serverLevel, AgeableMob ageableMob) {
-        Rabbit rabbit = EntityType.RABBIT.create(serverLevel);
-        if (rabbit != null) {
-            Rabbit.Variant variant = getRandomRabbitVariant(serverLevel, this.blockPosition());
+    public Rabbit getBreedOffspring(ServerLevel world, AgeableMob entity) {
+        Rabbit entityrabbit = (Rabbit) EntityType.RABBIT.create(world);
+
+        if (entityrabbit != null) {
+            Rabbit.Variant entityrabbit_variant = Rabbit.getRandomRabbitVariant(world, this.blockPosition());
+
             if (this.random.nextInt(20) != 0) {
-                label22: {
-                    if (ageableMob instanceof Rabbit) {
-                        Rabbit rabbit2 = (Rabbit)ageableMob;
+                label15:
+                {
+                    if (entity instanceof Rabbit) {
+                        Rabbit entityrabbit1 = (Rabbit) entity;
+
                         if (this.random.nextBoolean()) {
-                            variant = rabbit2.getVariant();
-                            break label22;
+                            entityrabbit_variant = entityrabbit1.getVariant();
+                            break label15;
                         }
                     }
 
-                    variant = this.getVariant();
+                    entityrabbit_variant = this.getVariant();
                 }
             }
 
-            rabbit.setVariant(variant);
+            entityrabbit.setVariant(entityrabbit_variant);
         }
 
-        return rabbit;
+        return entityrabbit;
     }
 
     @Override
     public boolean isFood(ItemStack stack) {
-        return isTemptingItem(stack);
+        return Rabbit.isTemptingItem(stack);
     }
 
     @Override
     public Rabbit.Variant getVariant() {
-        return Rabbit.Variant.byId(this.entityData.get(DATA_TYPE_ID));
+        return Rabbit.Variant.byId((Integer) this.entityData.get(Rabbit.DATA_TYPE_ID));
     }
 
-    @Override
     public void setVariant(Rabbit.Variant variant) {
         if (variant == Rabbit.Variant.EVIL) {
             this.getAttribute(Attributes.ARMOR).setBaseValue(8.0D);
             this.goalSelector.addGoal(4, new MeleeAttackGoal(this, 1.4D, true));
-            this.targetSelector.addGoal(1, (new HurtByTargetGoal(this)).setAlertOthers());
+            this.targetSelector.addGoal(1, (new HurtByTargetGoal(this, new Class[0])).setAlertOthers());
             this.targetSelector.addGoal(2, new NearestAttackableTargetGoal<>(this, Player.class, true));
             this.targetSelector.addGoal(2, new NearestAttackableTargetGoal<>(this, Wolf.class, true));
             if (!this.hasCustomName()) {
-                this.setCustomName(Component.translatable(Util.makeDescriptionId("entity", KILLER_BUNNY)));
+                this.setCustomName(Component.translatable(Util.makeDescriptionId("entity", Rabbit.KILLER_BUNNY)));
             }
         }
 
-        this.entityData.set(DATA_TYPE_ID, variant.id);
+        this.entityData.set(Rabbit.DATA_TYPE_ID, variant.id);
     }
 
     @Nullable
     @Override
     public SpawnGroupData finalizeSpawn(ServerLevelAccessor world, DifficultyInstance difficulty, MobSpawnType spawnReason, @Nullable SpawnGroupData entityData, @Nullable CompoundTag entityNbt) {
-        Rabbit.Variant variant = getRandomRabbitVariant(world, this.blockPosition());
+        Rabbit.Variant entityrabbit_variant = Rabbit.getRandomRabbitVariant(world, this.blockPosition());
+
         if (entityData instanceof Rabbit.RabbitGroupData) {
-            variant = ((Rabbit.RabbitGroupData)entityData).variant;
+            entityrabbit_variant = ((Rabbit.RabbitGroupData) entityData).variant;
         } else {
-            entityData = new Rabbit.RabbitGroupData(variant);
+            entityData = new Rabbit.RabbitGroupData(entityrabbit_variant);
         }
 
-        this.setVariant(variant);
-        return super.finalizeSpawn(world, difficulty, spawnReason, entityData, entityNbt);
+        this.setVariant(entityrabbit_variant);
+        return super.finalizeSpawn(world, difficulty, spawnReason, (SpawnGroupData) entityData, entityNbt);
     }
 
     private static Rabbit.Variant getRandomRabbitVariant(LevelAccessor world, BlockPos pos) {
         Holder<Biome> holder = world.getBiome(pos);
         int i = world.getRandom().nextInt(100);
-        if (holder.is(BiomeTags.SPAWNS_WHITE_RABBITS)) {
-            return i < 80 ? Rabbit.Variant.WHITE : Rabbit.Variant.WHITE_SPLOTCHED;
-        } else if (holder.is(BiomeTags.SPAWNS_GOLD_RABBITS)) {
-            return Rabbit.Variant.GOLD;
-        } else {
-            return i < 50 ? Rabbit.Variant.BROWN : (i < 90 ? Rabbit.Variant.SALT : Rabbit.Variant.BLACK);
-        }
+
+        return holder.is(BiomeTags.SPAWNS_WHITE_RABBITS) ? (i < 80 ? Rabbit.Variant.WHITE : Rabbit.Variant.WHITE_SPLOTCHED) : (holder.is(BiomeTags.SPAWNS_GOLD_RABBITS) ? Rabbit.Variant.GOLD : (i < 50 ? Rabbit.Variant.BROWN : (i < 90 ? Rabbit.Variant.SALT : Rabbit.Variant.BLACK)));
     }
 
     public static boolean checkRabbitSpawnRules(EntityType<Rabbit> entity, LevelAccessor world, MobSpawnType spawnReason, BlockPos pos, RandomSource random) {
@@ -424,33 +434,11 @@
 
     @Override
     public Vec3 getLeashOffset() {
-        return new Vec3(0.0D, (double)(0.6F * this.getEyeHeight()), (double)(this.getBbWidth() * 0.4F));
-    }
-
-    static class RabbitAvoidEntityGoal<T extends LivingEntity> extends AvoidEntityGoal<T> {
-        private final Rabbit rabbit;
-
-        public RabbitAvoidEntityGoal(Rabbit rabbit, Class<T> fleeFromType, float distance, double slowSpeed, double fastSpeed) {
-            super(rabbit, fleeFromType, distance, slowSpeed, fastSpeed);
-            this.rabbit = rabbit;
-        }
-
-        @Override
-        public boolean canUse() {
-            return this.rabbit.getVariant() != Rabbit.Variant.EVIL && super.canUse();
-        }
-    }
-
-    public static class RabbitGroupData extends AgeableMob.AgeableMobGroupData {
-        public final Rabbit.Variant variant;
-
-        public RabbitGroupData(Rabbit.Variant type) {
-            super(1.0F);
-            this.variant = type;
-        }
+        return new Vec3(0.0D, (double) (0.6F * this.getEyeHeight()), (double) (this.getBbWidth() * 0.4F));
     }
 
     public static class RabbitJumpControl extends JumpControl {
+
         private final Rabbit rabbit;
         private boolean canJump;
 
@@ -481,7 +469,8 @@
         }
     }
 
-    static class RabbitMoveControl extends MoveControl {
+    private static class RabbitMoveControl extends MoveControl {
+
         private final Rabbit rabbit;
         private double nextJumpSpeed;
 
@@ -492,7 +481,7 @@
 
         @Override
         public void tick() {
-            if (this.rabbit.onGround() && !this.rabbit.jumping && !((Rabbit.RabbitJumpControl)this.rabbit.jumpControl).wantJump()) {
+            if (this.rabbit.onGround() && !this.rabbit.jumping && !((Rabbit.RabbitJumpControl) this.rabbit.jumpControl).wantJump()) {
                 this.rabbit.setSpeedModifier(0.0D);
             } else if (this.hasWanted()) {
                 this.rabbit.setSpeedModifier(this.nextJumpSpeed);
@@ -515,7 +504,8 @@
         }
     }
 
-    static class RabbitPanicGoal extends PanicGoal {
+    private static class RabbitPanicGoal extends PanicGoal {
+
         private final Rabbit rabbit;
 
         public RabbitPanicGoal(Rabbit rabbit, double speed) {
@@ -530,13 +520,29 @@
         }
     }
 
-    static class RaidGardenGoal extends MoveToBlockGoal {
+    private static class RabbitAvoidEntityGoal<T extends LivingEntity> extends AvoidEntityGoal<T> {
+
+        private final Rabbit rabbit;
+
+        public RabbitAvoidEntityGoal(Rabbit rabbit, Class<T> fleeFromType, float distance, double slowSpeed, double fastSpeed) {
+            super(rabbit, fleeFromType, distance, slowSpeed, fastSpeed);
+            this.rabbit = rabbit;
+        }
+
+        @Override
+        public boolean canUse() {
+            return this.rabbit.getVariant() != Rabbit.Variant.EVIL && super.canUse();
+        }
+    }
+
+    private static class RaidGardenGoal extends MoveToBlockGoal {
+
         private final Rabbit rabbit;
         private boolean wantsToRaid;
         private boolean canRaid;
 
         public RaidGardenGoal(Rabbit rabbit) {
-            super(rabbit, (double)0.7F, 16);
+            super(rabbit, 0.699999988079071D, 16);
             this.rabbit = rabbit;
         }
 
@@ -562,21 +568,33 @@
         @Override
         public void tick() {
             super.tick();
-            this.rabbit.getLookControl().setLookAt((double)this.blockPos.getX() + 0.5D, (double)(this.blockPos.getY() + 1), (double)this.blockPos.getZ() + 0.5D, 10.0F, (float)this.rabbit.getMaxHeadXRot());
+            this.rabbit.getLookControl().setLookAt((double) this.blockPos.getX() + 0.5D, (double) (this.blockPos.getY() + 1), (double) this.blockPos.getZ() + 0.5D, 10.0F, (float) this.rabbit.getMaxHeadXRot());
             if (this.isReachedTarget()) {
-                Level level = this.rabbit.level();
-                BlockPos blockPos = this.blockPos.above();
-                BlockState blockState = level.getBlockState(blockPos);
-                Block block = blockState.getBlock();
+                Level world = this.rabbit.level();
+                BlockPos blockposition = this.blockPos.above();
+                BlockState iblockdata = world.getBlockState(blockposition);
+                Block block = iblockdata.getBlock();
+
                 if (this.canRaid && block instanceof CarrotBlock) {
-                    int i = blockState.getValue(CarrotBlock.AGE);
+                    int i = (Integer) iblockdata.getValue(CarrotBlock.AGE);
+
                     if (i == 0) {
-                        level.setBlock(blockPos, Blocks.AIR.defaultBlockState(), 2);
-                        level.destroyBlock(blockPos, true, this.rabbit);
+                        // CraftBukkit start
+                        if (!CraftEventFactory.callEntityChangeBlockEvent(this.rabbit, blockposition, iblockdata.getFluidState().createLegacyBlock())) { // Paper - fix wrong block state
+                            return;
+                        }
+                        // CraftBukkit end
+                        world.setBlock(blockposition, Blocks.AIR.defaultBlockState(), 2);
+                        world.destroyBlock(blockposition, true, this.rabbit);
                     } else {
-                        level.setBlock(blockPos, blockState.setValue(CarrotBlock.AGE, Integer.valueOf(i - 1)), 2);
-                        level.gameEvent(GameEvent.BLOCK_CHANGE, blockPos, GameEvent.Context.of(this.rabbit));
-                        level.levelEvent(2001, blockPos, Block.getId(blockState));
+                        // CraftBukkit start
+                        if (!CraftEventFactory.callEntityChangeBlockEvent(this.rabbit, blockposition, iblockdata.setValue(CarrotBlock.AGE, i - 1))) {
+                            return;
+                        }
+                        // CraftBukkit end
+                        world.setBlock(blockposition, (BlockState) iblockdata.setValue(CarrotBlock.AGE, i - 1), 2);
+                        world.gameEvent(GameEvent.BLOCK_CHANGE, blockposition, GameEvent.Context.of((Entity) this.rabbit));
+                        world.levelEvent(2001, blockposition, Block.getId(iblockdata));
                     }
 
                     this.rabbit.moreCarrotTicks = 40;
@@ -590,10 +608,11 @@
 
         @Override
         protected boolean isValidTarget(LevelReader world, BlockPos pos) {
-            BlockState blockState = world.getBlockState(pos);
-            if (blockState.is(Blocks.FARMLAND) && this.wantsToRaid && !this.canRaid) {
-                blockState = world.getBlockState(pos.above());
-                if (blockState.getBlock() instanceof CarrotBlock && ((CarrotBlock)blockState.getBlock()).isMaxAge(blockState)) {
+            BlockState iblockdata = world.getBlockState(pos);
+
+            if (iblockdata.is(Blocks.FARMLAND) && this.wantsToRaid && !this.canRaid) {
+                iblockdata = world.getBlockState(pos.above());
+                if (iblockdata.getBlock() instanceof CarrotBlock && ((CarrotBlock) iblockdata.getBlock()).isMaxAge(iblockdata)) {
                     this.canRaid = true;
                     return true;
                 }
@@ -604,22 +623,17 @@
     }
 
     public static enum Variant implements StringRepresentable {
-        BROWN(0, "brown"),
-        WHITE(1, "white"),
-        BLACK(2, "black"),
-        WHITE_SPLOTCHED(3, "white_splotched"),
-        GOLD(4, "gold"),
-        SALT(5, "salt"),
-        EVIL(99, "evil");
 
-        private static final IntFunction<Rabbit.Variant> BY_ID = ByIdMap.sparse(Rabbit.Variant::id, values(), BROWN);
+        BROWN(0, "brown"), WHITE(1, "white"), BLACK(2, "black"), WHITE_SPLOTCHED(3, "white_splotched"), GOLD(4, "gold"), SALT(5, "salt"), EVIL(99, "evil");
+
+        private static final IntFunction<Rabbit.Variant> BY_ID = ByIdMap.sparse(Rabbit.Variant::id, values(), Rabbit.Variant.BROWN);
         public static final Codec<Rabbit.Variant> CODEC = StringRepresentable.fromEnum(Rabbit.Variant::values);
         final int id;
         private final String name;
 
-        private Variant(int id, String name) {
-            this.id = id;
-            this.name = name;
+        private Variant(int i, String s) {
+            this.id = i;
+            this.name = s;
         }
 
         @Override
@@ -632,7 +646,17 @@
         }
 
         public static Rabbit.Variant byId(int id) {
-            return BY_ID.apply(id);
+            return (Rabbit.Variant) Rabbit.Variant.BY_ID.apply(id);
+        }
+    }
+
+    public static class RabbitGroupData extends AgeableMob.AgeableMobGroupData {
+
+        public final Rabbit.Variant variant;
+
+        public RabbitGroupData(Rabbit.Variant type) {
+            super(1.0F);
+            this.variant = type;
         }
     }
 }
