taboolib.module.ai.PathfinderCreatorImpl17 does not define or inherit
服务端: Purpur-1.20.1-build1996
问题: 似乎是nms版本不兼容的问题,请问如何解决
SimpleAi使用
class ZombieAi(val zombie: Zombie) : SimpleAi() {
private var target: Skeleton? = null
override fun shouldExecute(): Boolean {
target = zombie.world.getNearbyEntities(zombie.location, 10.0, 10.0, 10.0)
.filterIsInstance<Skeleton>()
.firstOrNull { it.equipment?.itemInMainHand?.type?.name?.contains("BOW") == true }
return target != null
}
override fun updateTask() {
target?.let { skeleton ->
// 向目标移动
zombie.navigationMove(skeleton, speed = 1.2)
// 如果距离小于 2 格,发动攻击
if (zombie.location.distance(skeleton.location) < 2.0) {
zombie.attack(skeleton)
}
}
}
override fun resetTask() {
target = null
}
}
@SubscribeEvent
fun onMobsSpawn(e: EntitySpawnEvent) {
if(e.entityType == EntityType.ZOMBIE) {
(e.entity as LivingEntity).apply {
clearGoalAi()
addGoalAi(ZombieAi(e.entity as Zombie), 1)
}
}
}
问题
java.lang.AbstractMethodError:
Receiver class com.gitee.mooovo.test.taboolib.module.ai.PathfinderCreatorImpl17
does not define or inherit an implementation of the resolved method 'abstract boolean a()' of abstract class
net.minecraft.world.entity.ai.goal.PathfinderGoal
不支持 Purpur
不支持 Purpur
谢谢,但是在使用spigot和paper时出现同样的问题
是否是我的方式出现了错误
spigot与paper报错相同
Caused by: java.lang.AbstractMethodError: Receiver class com.gitee.mooovo.test.taboolib.module.ai.PathfinderCreatorImpl17
does not define or inherit an implementation of the resolved method 'abstract boolean a()' of abstract class
net.minecraft.world.entity.ai.goal.PathfinderGoal.
gradle.kts
dependencies {
compileOnly("ink.ptms.core:v12001:12001:mapped")
compileOnly(kotlin("stdlib"))
compileOnly(fileTree("libs"))
}
@claude 咋搞
Claude finished @Bkm016's task —— View job • claude/issue-573-20250806-1751 • Create PR ➔
✅ Fixed PathfinderCreatorImpl17 AbstractMethodError
Todo List:
- [x] Search for PathfinderCreatorImpl17 implementation
- [x] Examine the PathfinderGoal abstract methods that need implementation
- [x] Check related implementations for reference
- [x] Fix the missing method implementation
- [x] Verify the solution addresses NMS compatibility
Problem & Solution
Root Cause: The PathfinderCreatorImpl17 class was missing the obfuscated method implementations that the Minecraft server expects. While it had the deobfuscated method names (canUse(), etc.), it was missing the obfuscated method names (a(), b(), etc.) that the server actually calls at runtime.
Fix Applied: Added all missing obfuscated methods to match the working PathfinderCreatorImpl (1.16.5 version):
-
a()→shouldExecute()(the missing method from your error!) -
b()→continueExecute() -
c()→startTask() -
d()→resetTask() -
e()→updateTask()
The class now implements both obfuscated and deobfuscated method names for maximum compatibility across different server mappings.
Result
This should resolve the AbstractMethodError you were seeing with Purpur, Spigot, and Paper servers. Your ZombieAi implementation should now work correctly with the AI module.