diff --git a/eco-core/core-nms/nms-common/src/main/kotlin/com/willfp/eco/internal/spigot/proxy/common/ai/CustomGoals.kt b/eco-core/core-nms/nms-common/src/main/kotlin/com/willfp/eco/internal/spigot/proxy/common/ai/CustomGoals.kt index a111f85ac..28ae0dfbc 100644 --- a/eco-core/core-nms/nms-common/src/main/kotlin/com/willfp/eco/internal/spigot/proxy/common/ai/CustomGoals.kt +++ b/eco-core/core-nms/nms-common/src/main/kotlin/com/willfp/eco/internal/spigot/proxy/common/ai/CustomGoals.kt @@ -2,6 +2,7 @@ package com.willfp.eco.internal.spigot.proxy.common.ai import com.willfp.eco.core.entities.ai.CustomGoal import com.willfp.eco.core.entities.ai.GoalFlag +import com.willfp.eco.internal.spigot.proxy.common.toBukkitEntity import net.minecraft.world.entity.PathfinderMob import net.minecraft.world.entity.ai.goal.Goal import java.util.EnumSet @@ -51,7 +52,7 @@ private class NMSCustomGoal( ) : Goal() { init { @Suppress("UNCHECKED_CAST") - customEntityGoal.initialize(entity.bukkitMob as T) + customEntityGoal.initialize(entity.toBukkitEntity() as T) this.setFlags(EnumSet.copyOf(customEntityGoal.flags.toNMSFlags())) }