Начинающий
Начинающий
- Статус
- Оффлайн
- Регистрация
- 5 Окт 2025
- Сообщения
- 33
- Реакции
- 0
Не получается отрендерить голову игрока И иконки брони на 1.21.8 фабрик
java:
if (target instanceof PlayerEntity player) {
SkinTextures skin = mc.getSkinProvider().getSkinTextures(player.getGameProfile());
PlayerSkinDrawer.draw(
context,
skin.texture(),
(int)(b.x() + 6),
(int)(b.y() + 6),
32,
true,
false,
0xFFFFFFFF
);
}
java:
if (target instanceof PlayerEntity player) {
ItemStack[] armor = new ItemStack[] {
player.getEquippedStack(EquipmentSlot.HEAD),
player.getEquippedStack(EquipmentSlot.CHEST),
player.getEquippedStack(EquipmentSlot.LEGS),
player.getEquippedStack(EquipmentSlot.FEET)
};
for (int i = 0; i < armor.length; i++) {
ItemStack stack = armor[i];
if (!stack.isEmpty()) {
int x = (int)(b.x() + 6 + 41 + i * 16);
int y = (int)(b.y() + b.height() - 18);
context.drawItem(stack, x, y);
context.drawStackOverlay(mc.textRenderer, stack, x, y);
}
}
}