Fabric API

Fabric API

152M Downloads

[<=1.20] Cannot find class net.fabricmc.fabric.api.attachment.v1.AttachmentTarget

Closed this issue ยท 1 comments

commented

I'm getting the error when building my fabric mod with gradle.

The error message says the source of the error is at:

// player is an instance of ServerPlayerEntity
player.getServer().getPlayerManager();
//    ^

and

// serverPlayer is an instance of ServerPlayerEntity
serverPlayer.isDisconnected();

and every place that called the method of ServerPlayerEntity

gradle.properties:

minecraft_version=1.19
yarn_mappings=1.19+build.4
fabric_loader_version=0.16.14
fabric_api_version=0.58.0

build.gradle:

// ...
dependencies {
    minecraft "com.mojang:minecraft:${minecraft_version}"
    mappings "net.fabricmc:yarn:${yarn_mappings}:v2"
    modImplementation "net.fabricmc:fabric-loader:${fabric_loader_version}"
    modImplementation "net.fabricmc.fabric-api:fabric-api:${fabric_api_version}+${minecraft_version}"
    // ...
}
// ...

This issue is wierd, and I can't figure it out.
And I found mc versions >= 1.20.1 don't have this issue.

commented

Solved