--- a/net/minecraft/world/entity/animal/Rabbit.java
+++ b/net/minecraft/world/entity/animal/Rabbit.java
@@ -26,6 +26,7 @@
 import net.minecraft.world.DifficultyInstance;
 import net.minecraft.world.damagesource.DamageSource;
 import net.minecraft.world.entity.AgeableMob;
+import net.minecraft.world.entity.Entity;
 import net.minecraft.world.entity.EntityType;
 import net.minecraft.world.entity.LivingEntity;
 import net.minecraft.world.entity.Mob;
@@ -65,13 +66,17 @@
 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.event.CraftEventFactory;
+// CraftBukkit end
 
 public class Rabbit extends Animal implements VariantHolder<Rabbit.Variant> {
-    public static final double STROLL_SPEED_MOD = 0.6;
-    public static final double BREED_SPEED_MOD = 0.8;
-    public static final double FOLLOW_SPEED_MOD = 1.0;
-    public static final double FLEE_SPEED_MOD = 2.2;
-    public static final double ATTACK_SPEED_MOD = 1.4;
+
+    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;
+    public static final double FLEE_SPEED_MOD = 2.2D;
+    public static final double ATTACK_SPEED_MOD = 1.4D;
     private static final EntityDataAccessor<Integer> DATA_TYPE_ID = SynchedEntityData.defineId(Rabbit.class, EntityDataSerializers.INT);
     private static final ResourceLocation KILLER_BUNNY = ResourceLocation.withDefaultNamespace("killer_bunny");
     private static final int DEFAULT_ATTACK_POWER = 3;
@@ -89,40 +94,44 @@
         super(type, world);
         this.jumpControl = new Rabbit.RabbitJumpControl(this);
         this.moveControl = new Rabbit.RabbitMoveControl(this);
-        this.setSpeedModifier(0.0);
     }
 
     @Override
     public void registerGoals() {
         this.goalSelector.addGoal(1, new FloatGoal(this));
         this.goalSelector.addGoal(1, new ClimbOnTopOfPowderSnowGoal(this, this.level()));
-        this.goalSelector.addGoal(1, new Rabbit.RabbitPanicGoal(this, 2.2));
-        this.goalSelector.addGoal(2, new BreedGoal(this, 0.8));
-        this.goalSelector.addGoal(3, new TemptGoal(this, 1.0, stack -> stack.is(ItemTags.RABBIT_FOOD), false));
-        this.goalSelector.addGoal(4, new Rabbit.RabbitAvoidEntityGoal<>(this, Player.class, 8.0F, 2.2, 2.2));
-        this.goalSelector.addGoal(4, new Rabbit.RabbitAvoidEntityGoal<>(this, Wolf.class, 10.0F, 2.2, 2.2));
-        this.goalSelector.addGoal(4, new Rabbit.RabbitAvoidEntityGoal<>(this, Monster.class, 4.0F, 2.2, 2.2));
+        this.goalSelector.addGoal(1, new Rabbit.RabbitPanicGoal(this, 2.2D));
+        this.goalSelector.addGoal(2, new BreedGoal(this, 0.8D));
+        this.goalSelector.addGoal(3, new TemptGoal(this, 1.0D, (itemstack) -> {
+            return itemstack.is(ItemTags.RABBIT_FOOD);
+        }, false));
+        this.goalSelector.addGoal(4, new Rabbit.RabbitAvoidEntityGoal<>(this, Player.class, 8.0F, 2.2D, 2.2D));
+        this.goalSelector.addGoal(4, new Rabbit.RabbitAvoidEntityGoal<>(this, Wolf.class, 10.0F, 2.2D, 2.2D));
+        this.goalSelector.addGoal(4, new Rabbit.RabbitAvoidEntityGoal<>(this, Monster.class, 4.0F, 2.2D, 2.2D));
         this.goalSelector.addGoal(5, new Rabbit.RaidGardenGoal(this));
-        this.goalSelector.addGoal(6, new WaterAvoidingRandomStrollGoal(this, 0.6));
+        this.goalSelector.addGoal(6, new WaterAvoidingRandomStrollGoal(this, 0.6D));
         this.goalSelector.addGoal(11, new LookAtPlayerGoal(this, Player.class, 10.0F));
     }
 
     @Override
     protected float getJumpPower() {
         float f = 0.3F;
-        if (this.horizontalCollision || this.moveControl.hasWanted() && this.moveControl.getWantedY() > this.getY() + 0.5) {
+
+        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.5) {
+        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;
             }
         }
 
-        if (this.moveControl.getSpeedModifier() <= 0.6) {
+        if (this.moveControl.getSpeedModifier() <= 0.6D) {
             f = 0.2F;
         }
 
@@ -132,21 +141,24 @@
     @Override
     public void jumpFromGround() {
         super.jumpFromGround();
-        double d = this.moveControl.getSpeedModifier();
-        if (d > 0.0) {
-            double e = this.getDeltaMovement().horizontalDistanceSqr();
-            if (e < 0.01) {
-                this.moveRelative(0.1F, new Vec3(0.0, 0.0, 1.0));
+        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) {
@@ -160,6 +172,7 @@
         if (jumping) {
             this.playSound(this.getJumpSound(), this.getSoundVolume(), ((this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.0F) * 0.8F);
         }
+
     }
 
     public void startJumping() {
@@ -171,17 +184,17 @@
     @Override
     protected void defineSynchedData(SynchedEntityData.Builder builder) {
         super.defineSynchedData(builder);
-        builder.define(DATA_TYPE_ID, Rabbit.Variant.BROWN.id);
+        builder.define(Rabbit.DATA_TYPE_ID, Rabbit.Variant.BROWN.id);
     }
 
     @Override
     public void customServerAiStep() {
         if (this.jumpDelayTicks > 0) {
-            this.jumpDelayTicks--;
+            --this.jumpDelayTicks;
         }
 
         if (this.moreCarrotTicks > 0) {
-            this.moreCarrotTicks = this.moreCarrotTicks - this.random.nextInt(3);
+            this.moreCarrotTicks -= this.random.nextInt(3);
             if (this.moreCarrotTicks < 0) {
                 this.moreCarrotTicks = 0;
             }
@@ -194,28 +207,31 @@
             }
 
             if (this.getVariant() == Rabbit.Variant.EVIL && this.jumpDelayTicks == 0) {
-                LivingEntity livingEntity = this.getTarget();
-                if (livingEntity != null && this.distanceToSqr(livingEntity) < 16.0) {
-                    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();
             }
         }
@@ -229,23 +245,24 @@
     }
 
     private void facePoint(double x, double z) {
-        this.setYRot((float)(Mth.atan2(z - this.getZ(), x - this.getX()) * 180.0F / (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() {
-        if (this.moveControl.getSpeedModifier() < 2.2) {
+        if (this.moveControl.getSpeedModifier() < 2.2D) {
             this.jumpDelayTicks = 10;
         } else {
             this.jumpDelayTicks = 1;
         }
+
     }
 
     private void checkLandingDelay() {
@@ -257,16 +274,17 @@
     public void aiStep() {
         super.aiStep();
         if (this.jumpTicks != this.jumpDuration) {
-            this.jumpTicks++;
+            ++this.jumpTicks;
         } else if (this.jumpDuration != 0) {
             this.jumpTicks = 0;
             this.jumpDuration = 0;
             this.setJumping(false);
         }
+
     }
 
     public static AttributeSupplier.Builder createAttributes() {
-        return Mob.createMobAttributes().add(Attributes.MAX_HEALTH, 3.0).add(Attributes.MOVEMENT_SPEED, 0.3F).add(Attributes.ATTACK_DAMAGE, 3.0);
+        return Mob.createMobAttributes().add(Attributes.MAX_HEALTH, 3.0D).add(Attributes.MOVEMENT_SPEED, 0.30000001192092896D).add(Attributes.ATTACK_DAMAGE, 3.0D);
     }
 
     @Override
@@ -307,6 +325,7 @@
         if (this.getVariant() == Rabbit.Variant.EVIL) {
             this.playSound(SoundEvents.RABBIT_ATTACK, 1.0F, (this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.0F);
         }
+
     }
 
     @Override
@@ -316,25 +335,32 @@
 
     @Nullable
     @Override
-    public Rabbit getBreedOffspring(ServerLevel serverLevel, AgeableMob ageableMob) {
-        Rabbit rabbit = EntityType.RABBIT.create(serverLevel);
-        if (rabbit != null) {
-            Rabbit.Variant variant;
-            variant = getRandomRabbitVariant(serverLevel, this.blockPosition());
-            label16:
+    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) {
-                if (ageableMob instanceof Rabbit rabbit2 && this.random.nextBoolean()) {
-                    variant = rabbit2.getVariant();
-                    break label16;
-                }
+                label15:
+                {
+                    if (entity instanceof Rabbit) {
+                        Rabbit entityrabbit1 = (Rabbit) entity;
 
-                variant = this.getVariant();
+                        if (this.random.nextBoolean()) {
+                            entityrabbit_variant = entityrabbit1.getVariant();
+                            break label15;
+                        }
+                    }
+
+                    entityrabbit_variant = this.getVariant();
+                }
             }
 
-            rabbit.setVariant(variant);
+            entityrabbit.setVariant(entityrabbit_variant);
         }
 
-        return rabbit;
+        return entityrabbit;
     }
 
     @Override
@@ -344,53 +370,47 @@
 
     @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.0);
-            this.goalSelector.addGoal(4, new MeleeAttackGoal(this, 1.4, true));
-            this.targetSelector.addGoal(1, new HurtByTargetGoal(this).setAlertOthers());
+            this.getAttribute(Attributes.ARMOR).setBaseValue(8.0D);
+            this.goalSelector.addGoal(4, new MeleeAttackGoal(this, 1.4D, true));
+            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));
-            this.getAttribute(Attributes.ATTACK_DAMAGE)
-                .addOrUpdateTransientModifier(new AttributeModifier(EVIL_ATTACK_POWER_MODIFIER, 5.0, AttributeModifier.Operation.ADD_VALUE));
+            this.getAttribute(Attributes.ATTACK_DAMAGE).addOrUpdateTransientModifier(new AttributeModifier(Rabbit.EVIL_ATTACK_POWER_MODIFIER, 5.0D, AttributeModifier.Operation.ADD_VALUE));
             if (!this.hasCustomName()) {
-                this.setCustomName(Component.translatable(Util.makeDescriptionId("entity", KILLER_BUNNY)));
+                this.setCustomName(Component.translatable(Util.makeDescriptionId("entity", Rabbit.KILLER_BUNNY)));
             }
         } else {
-            this.getAttribute(Attributes.ATTACK_DAMAGE).removeModifier(EVIL_ATTACK_POWER_MODIFIER);
+            this.getAttribute(Attributes.ATTACK_DAMAGE).removeModifier(Rabbit.EVIL_ATTACK_POWER_MODIFIER);
         }
 
-        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) {
-        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);
+        this.setVariant(entityrabbit_variant);
+        return super.finalizeSpawn(world, difficulty, spawnReason, (SpawnGroupData) entityData);
     }
 
     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) {
@@ -410,37 +430,16 @@
         } else {
             super.handleEntityEvent(status);
         }
+
     }
 
     @Override
     public Vec3 getLeashOffset() {
-        return new Vec3(0.0, (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;
 
@@ -467,10 +466,12 @@
                 this.rabbit.startJumping();
                 this.jump = false;
             }
+
         }
     }
 
-    static class RabbitMoveControl extends MoveControl {
+    private static class RabbitMoveControl extends MoveControl {
+
         private final Rabbit rabbit;
         private double nextJumpSpeed;
 
@@ -481,8 +482,8 @@
 
         @Override
         public void tick() {
-            if (this.rabbit.onGround() && !this.rabbit.jumping && !((Rabbit.RabbitJumpControl)this.rabbit.jumpControl).wantJump()) {
-                this.rabbit.setSpeedModifier(0.0);
+            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);
             }
@@ -493,17 +494,19 @@
         @Override
         public void setWantedPosition(double x, double y, double z, double speed) {
             if (this.rabbit.isInWater()) {
-                speed = 1.5;
+                speed = 1.5D;
             }
 
             super.setWantedPosition(x, y, z, speed);
-            if (speed > 0.0) {
+            if (speed > 0.0D) {
                 this.nextJumpSpeed = speed;
             }
+
         }
     }
 
-    static class RabbitPanicGoal extends PanicGoal {
+    private static class RabbitPanicGoal extends PanicGoal {
+
         private final Rabbit rabbit;
 
         public RabbitPanicGoal(Rabbit rabbit, double speed) {
@@ -518,13 +521,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, 0.7F, 16);
+            super(rabbit, 0.699999988079071D, 16);
             this.rabbit = rabbit;
         }
 
@@ -550,29 +569,33 @@
         @Override
         public void tick() {
             super.tick();
-            this.rabbit
-                .getLookControl()
-                .setLookAt(
-                    (double)this.blockPos.getX() + 0.5,
-                    (double)(this.blockPos.getY() + 1),
-                    (double)this.blockPos.getZ() + 0.5,
-                    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((Holder) GameEvent.BLOCK_CHANGE, blockposition, GameEvent.Context.of((Entity) this.rabbit));
+                        world.levelEvent(2001, blockposition, Block.getId(iblockdata));
                     }
 
                     this.rabbit.moreCarrotTicks = 40;
@@ -581,14 +604,16 @@
                 this.canRaid = false;
                 this.nextStartTick = 10;
             }
+
         }
 
         @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;
                 }
@@ -599,22 +624,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(final int id, final String name) {
-            this.id = id;
-            this.name = name;
+        private Variant(final int i, final String s) {
+            this.id = i;
+            this.name = s;
         }
 
         @Override
@@ -627,7 +647,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;
         }
     }
 }
