--- a/net/minecraft/world/entity/ai/behavior/InteractWith.java
+++ b/net/minecraft/world/entity/ai/behavior/InteractWith.java
@@ -45,7 +45,7 @@
                                         p_325690_ -> p_325690_.distanceToSqr(p_258414_) <= (double)i && predicate.test(p_325690_)
                                     );
                                     optional.ifPresent(p_258432_ -> {
-                                        p_258439_.set(p_258432_);
+                                        p_258439_.set((T)p_258432_);
                                         p_258440_.set(new EntityTracker(p_258432_, true));
                                         p_258441_.set(new WalkTarget(new EntityTracker(p_258432_, false), p_259369_, p_259065_));
                                     });
