--- a/net/minecraft/util/ClassInstanceMultiMap.java
+++ b/net/minecraft/util/ClassInstanceMultiMap.java
@@ -61,7 +61,7 @@
         } else {
             List<? extends T> list = this.byClass
                 .computeIfAbsent(p_13534_, p_13538_ -> this.allInstances.stream().filter(p_13538_::isInstance).collect(Collectors.toList()));
-            return Collections.unmodifiableCollection(list);
+            return (Collection<S>)Collections.unmodifiableCollection(list);
         }
     }
 
