--- a/net/minecraft/world/entity/Interaction.java
+++ b/net/minecraft/world/entity/Interaction.java
@@ -2,7 +2,9 @@
 
 import com.mojang.logging.LogUtils;
 import com.mojang.serialization.Codec;
+import com.mojang.serialization.DataResult;
 import com.mojang.serialization.codecs.RecordCodecBuilder;
+import java.util.Objects;
 import java.util.UUID;
 import javax.annotation.Nullable;
 import net.minecraft.Util;
@@ -14,15 +16,21 @@
 import net.minecraft.network.syncher.EntityDataSerializers;
 import net.minecraft.network.syncher.SynchedEntityData;
 import net.minecraft.server.level.ServerPlayer;
+import org.slf4j.Logger;
 import net.minecraft.world.InteractionHand;
 import net.minecraft.world.InteractionResult;
+// CraftBukkit start
+import net.minecraft.world.damagesource.DamageSource;
 import net.minecraft.world.entity.player.Player;
 import net.minecraft.world.level.Level;
 import net.minecraft.world.level.material.PushReaction;
 import net.minecraft.world.phys.AABB;
-import org.slf4j.Logger;
+import org.bukkit.craftbukkit.event.CraftEventFactory;
+import org.bukkit.event.entity.EntityDamageEvent;
+// CraftBukkit end
 
 public class Interaction extends Entity implements Attackable, Targeting {
+
     private static final Logger LOGGER = LogUtils.getLogger();
     private static final EntityDataAccessor<Float> DATA_WIDTH_ID = SynchedEntityData.defineId(Interaction.class, EntityDataSerializers.FLOAT);
     private static final EntityDataAccessor<Float> DATA_HEIGHT_ID = SynchedEntityData.defineId(Interaction.class, EntityDataSerializers.FLOAT);
@@ -44,9 +52,9 @@
 
     @Override
     protected void defineSynchedData(SynchedEntityData.Builder builder) {
-        builder.define(DATA_WIDTH_ID, 1.0F);
-        builder.define(DATA_HEIGHT_ID, 1.0F);
-        builder.define(DATA_RESPONSE_ID, false);
+        builder.define(Interaction.DATA_WIDTH_ID, 1.0F);
+        builder.define(Interaction.DATA_HEIGHT_ID, 1.0F);
+        builder.define(Interaction.DATA_RESPONSE_ID, false);
     }
 
     @Override
@@ -59,20 +67,27 @@
             this.setHeight(nbt.getFloat("height"));
         }
 
+        DataResult<com.mojang.datafixers.util.Pair<Interaction.PlayerAction, net.minecraft.nbt.Tag>> dataresult; // CraftBukkit - decompile error
+        Logger logger;
+
         if (nbt.contains("attack")) {
-            Interaction.PlayerAction.CODEC
-                .decode(NbtOps.INSTANCE, nbt.get("attack"))
-                .resultOrPartial(Util.prefix("Interaction entity", LOGGER::error))
-                .ifPresent(pair -> this.attack = pair.getFirst());
+            dataresult = Interaction.PlayerAction.CODEC.decode(NbtOps.INSTANCE, nbt.get("attack"));
+            logger = Interaction.LOGGER;
+            Objects.requireNonNull(logger);
+            dataresult.resultOrPartial(Util.prefix("Interaction entity", logger::error)).ifPresent((pair) -> {
+                this.attack = (Interaction.PlayerAction) pair.getFirst();
+            });
         } else {
             this.attack = null;
         }
 
         if (nbt.contains("interaction")) {
-            Interaction.PlayerAction.CODEC
-                .decode(NbtOps.INSTANCE, nbt.get("interaction"))
-                .resultOrPartial(Util.prefix("Interaction entity", LOGGER::error))
-                .ifPresent(pair -> this.interaction = pair.getFirst());
+            dataresult = Interaction.PlayerAction.CODEC.decode(NbtOps.INSTANCE, nbt.get("interaction"));
+            logger = Interaction.LOGGER;
+            Objects.requireNonNull(logger);
+            dataresult.resultOrPartial(Util.prefix("Interaction entity", logger::error)).ifPresent((pair) -> {
+                this.interaction = (Interaction.PlayerAction) pair.getFirst();
+            });
         } else {
             this.interaction = null;
         }
@@ -86,11 +101,15 @@
         nbt.putFloat("width", this.getWidth());
         nbt.putFloat("height", this.getHeight());
         if (this.attack != null) {
-            Interaction.PlayerAction.CODEC.encodeStart(NbtOps.INSTANCE, this.attack).ifSuccess(tag -> nbt.put("attack", tag));
+            Interaction.PlayerAction.CODEC.encodeStart(NbtOps.INSTANCE, this.attack).ifSuccess((nbtbase) -> {
+                nbt.put("attack", nbtbase);
+            });
         }
 
         if (this.interaction != null) {
-            Interaction.PlayerAction.CODEC.encodeStart(NbtOps.INSTANCE, this.interaction).ifSuccess(tag -> nbt.put("interaction", tag));
+            Interaction.PlayerAction.CODEC.encodeStart(NbtOps.INSTANCE, this.interaction).ifSuccess((nbtbase) -> {
+                nbt.put("interaction", nbtbase);
+            });
         }
 
         nbt.putBoolean("response", this.getResponse());
@@ -99,9 +118,10 @@
     @Override
     public void onSyncedDataUpdated(EntityDataAccessor<?> data) {
         super.onSyncedDataUpdated(data);
-        if (DATA_HEIGHT_ID.equals(data) || DATA_WIDTH_ID.equals(data)) {
+        if (Interaction.DATA_HEIGHT_ID.equals(data) || Interaction.DATA_WIDTH_ID.equals(data)) {
             this.setBoundingBox(this.makeBoundingBox());
         }
+
     }
 
     @Override
@@ -126,10 +146,17 @@
 
     @Override
     public boolean skipAttackInteraction(Entity attacker) {
-        if (attacker instanceof Player player) {
-            this.attack = new Interaction.PlayerAction(player.getUUID(), this.level().getGameTime());
-            if (player instanceof ServerPlayer serverPlayer) {
-                CriteriaTriggers.PLAYER_HURT_ENTITY.trigger(serverPlayer, this, player.damageSources().generic(), 1.0F, 1.0F, false);
+        if (attacker instanceof Player entityhuman) {
+            // CraftBukkit start
+            DamageSource source = entityhuman.damageSources().playerAttack(entityhuman);
+            EntityDamageEvent event = CraftEventFactory.callNonLivingEntityDamageEvent(this, source, 1.0F, false);
+            if (event.isCancelled()) {
+                return true;
+            }
+            // CraftBukkit end
+            this.attack = new Interaction.PlayerAction(entityhuman.getUUID(), this.level().getGameTime());
+            if (entityhuman instanceof ServerPlayer entityplayer) {
+                CriteriaTriggers.PLAYER_HURT_ENTITY.trigger(entityplayer, this, entityhuman.damageSources().generic(), 1.0F, (float) event.getFinalDamage(), false); // CraftBukkit // Paper - use correct source and fix taken/dealt param order
             }
 
             return !this.getResponse();
@@ -149,8 +176,7 @@
     }
 
     @Override
-    public void tick() {
-    }
+    public void tick() {}
 
     @Nullable
     @Override
@@ -165,27 +191,27 @@
     }
 
     public void setWidth(float width) {
-        this.entityData.set(DATA_WIDTH_ID, width);
+        this.entityData.set(Interaction.DATA_WIDTH_ID, width);
     }
 
     public float getWidth() {
-        return this.entityData.get(DATA_WIDTH_ID);
+        return (Float) this.entityData.get(Interaction.DATA_WIDTH_ID);
     }
 
     public void setHeight(float height) {
-        this.entityData.set(DATA_HEIGHT_ID, height);
+        this.entityData.set(Interaction.DATA_HEIGHT_ID, height);
     }
 
     public float getHeight() {
-        return this.entityData.get(DATA_HEIGHT_ID);
+        return (Float) this.entityData.get(Interaction.DATA_HEIGHT_ID);
     }
 
     public void setResponse(boolean response) {
-        this.entityData.set(DATA_RESPONSE_ID, response);
+        this.entityData.set(Interaction.DATA_RESPONSE_ID, response);
     }
 
     public boolean getResponse() {
-        return this.entityData.get(DATA_RESPONSE_ID);
+        return (Boolean) this.entityData.get(Interaction.DATA_RESPONSE_ID);
     }
 
     private EntityDimensions getDimensions() {
@@ -203,12 +229,9 @@
     }
 
     public static record PlayerAction(UUID player, long timestamp) {
-        public static final Codec<Interaction.PlayerAction> CODEC = RecordCodecBuilder.create(
-            instance -> instance.group(
-                        UUIDUtil.CODEC.fieldOf("player").forGetter(Interaction.PlayerAction::player),
-                        Codec.LONG.fieldOf("timestamp").forGetter(Interaction.PlayerAction::timestamp)
-                    )
-                    .apply(instance, Interaction.PlayerAction::new)
-        );
+
+        public static final Codec<Interaction.PlayerAction> CODEC = RecordCodecBuilder.create((instance) -> {
+            return instance.group(UUIDUtil.CODEC.fieldOf("player").forGetter(Interaction.PlayerAction::player), Codec.LONG.fieldOf("timestamp").forGetter(Interaction.PlayerAction::timestamp)).apply(instance, Interaction.PlayerAction::new);
+        });
     }
 }
