I'm currently trying to create a Spigot plugin, but I need to use GameProfile to apply textures, and I can't seem to import it. When I import it using:
import com.mojang.authlib.GameProfile;
I get the error: Cannot resolve symbol 'mojang'
I'm using IntelliJ with Maven, and I've been struggling with this issue for two days now. I've tried the solutions suggested in these posts:
How can I import com.mojang.authlib.GameProfile
https://www.spigotmc.org/threads/how-do-i-access-gameprofile.450589/
None of them have worked so far. In all of these posts, they mention adding a repository and the dependency authlib-1.5.21
. I've tried each of their solutions, but each time I end up with the same error.
<repositories>
<repository>
<id>minecraft-repo</id>
<url>https://libraries.minecraft.net/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>com.mojang</groupId>
<artifactId>authlib</artifactId>
<version>1.5.21</version>
<scope>provided</scope>
</dependency>
</dependencies>
Dependency 'com.mojang:authlib:1.5.21' not found
I also tried importing my spigot-1.20.1.rar
file in Project Structure -> Project Settings -> Modules -> Dependencies
based on a video I watched, but that didn't work either.
I used the Minecraft extension in IntelliJ to create my plugin, which provides presets. I also tried to do it without using the extension, but it still didn't work.