Вопрос Текстура головы

Решение
Java:
        <repository>
            <id>authlib</id>
            <url>https://papermc.io/repo/repository/maven-releases/</url>
        </repository>

        <dependency>
            <groupId>com.mojang</groupId>
            <artifactId>authlib</artifactId>
            <version>1.5.25</version>
            <scope>provided</scope>
        </dependency>
Java:
ItemStack item = new ItemStack(Material.PLAYER_HEAD);
SkullMeta skullmeta = (SkullMeta) item.getItemMeta();
final GameProfile profile = new GameProfile(UUID.randomUUID(), null);
profile.getProperties().put("textures", new Property("textures", "Сюда текстурку"));
try {
  final Field profileField = skullmeta.getClass().getDeclaredField("profile")...
Java:
        <repository>
            <id>authlib</id>
            <url>https://papermc.io/repo/repository/maven-releases/</url>
        </repository>

        <dependency>
            <groupId>com.mojang</groupId>
            <artifactId>authlib</artifactId>
            <version>1.5.25</version>
            <scope>provided</scope>
        </dependency>
Java:
ItemStack item = new ItemStack(Material.PLAYER_HEAD);
SkullMeta skullmeta = (SkullMeta) item.getItemMeta();
final GameProfile profile = new GameProfile(UUID.randomUUID(), null);
profile.getProperties().put("textures", new Property("textures", "Сюда текстурку"));
try {
  final Field profileField = skullmeta.getClass().getDeclaredField("profile");
  profileField.setAccessible(true);
  profileField.set(skullmeta, profile);
}
catch (IllegalAccessException | NoSuchFieldException ex2) {
  ex2.printStackTrace();
 }
item.setItemMeta(skullmeta);
 
Назад
Сверху Снизу