Поворачивать модель стива мышкой в кастомном инвентаре.

Версия Minecraft
1.12.2
Переменная которая будет отвечать за поворот. В методе, где учитывается нажатие и его отпускание, проверять на сколько стрелка мышки двинулать по оси икс прибавлять или убавлять значение у переменной. Перед рендером игрока использовать rotate и это под push и pop - Matrix завернуть (через класс GlStateManager).
 
Java:
    private void drawEntityOnScreen(int xPos, int yPos, int scale, float xMouse, float yMouse, EntityLivingBase entityLivingBase)
    {
        GlStateManager.pushMatrix();
        GlStateManager.enableColorMaterial();

        GlStateManager.translate(xPos, yPos, 50.0F);
        GlStateManager.scale(-scale, scale, scale);
        GlStateManager.rotate(180.0F, 0.0F, 0.0F, 1.0F);

        float localRenderYawOffset = entityLivingBase.renderYawOffset;
        float localRotationYaw = entityLivingBase.rotationYaw;
        float localRotationPitch = entityLivingBase.rotationPitch;
        float localPrevRotationYawHead = entityLivingBase.prevRotationYawHead;
        float localRotationYawHead = entityLivingBase.rotationYawHead;

        GlStateManager.rotate(135.0F, 0.0F, 1.0F, 0.0F);
        RenderHelper.enableStandardItemLighting();
        GlStateManager.rotate(-135.0F, 0.0F, 1.0F, 0.0F);
        GlStateManager.rotate(20.0F, 1.0F, 0.0F, 0.0F);

        entityLivingBase.renderYawOffset = (float) Math.atan((double)(xMouse / 40.0F)) * 20.0F;
        GlStateManager.rotate((xMouse >= xSize / 2) ? Math.max(-((xMouse-xSize / 2) * 1.2F), -180) : 0.0F, 0.0F, 1.0F, 0.0F);

        entityLivingBase.rotationYaw = (float)Math.atan((double)(xMouse / 40.0F)) * 40.0F;
        entityLivingBase.rotationPitch = -((float)Math.atan((double)(yMouse / 40.0F))) * 20.0F;
        entityLivingBase.rotationYawHead = entityLivingBase.rotationYaw;
        entityLivingBase.prevRotationYawHead = entityLivingBase.rotationYaw;

        RenderManager.instance.playerViewY = 180.0F;
        RenderManager.instance.renderEntityWithPosYaw(entityLivingBase, 0.0D, 0.0D, 0.0D, 0.0F, 1.0F);

        entityLivingBase.renderYawOffset = localRenderYawOffset;
        entityLivingBase.rotationYaw = localRotationYaw;
        entityLivingBase.rotationPitch = localRotationPitch;
        entityLivingBase.prevRotationYawHead = localPrevRotationYawHead;
        entityLivingBase.rotationYawHead = localRotationYawHead;

        RenderHelper.disableStandardItemLighting();
        GlStateManager.disableRescaleNormal();
        OpenGlHelper.setActiveTexture(OpenGlHelper.lightmapTexUnit);
        GlStateManager.disableTexture2d();
        OpenGlHelper.setActiveTexture(OpenGlHelper.defaultTexUnit);

        GlStateManager.popMatrix();

    }

Только в моем случае я поворачиваю модель когда мышка в левой части экрана.
 
Назад
Сверху