A mod that adds your armor to the hud modrinth.com/mod/simple-armor-hud
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat: added hotbar armorhud positions

legoraft cbd338ef 5b282150

+18 -1
+2 -1
src/client/java/com/armorhud/config/config.java
··· 24 24 public enum Position { 25 25 FOODBAR, 26 26 HEALTHBAR, 27 - HOTBAR_LEFT; 27 + HOTBAR_LEFT, 28 + HOTBAR_RIGHT; 28 29 29 30 public Text displayName() { 30 31 return Text.translatable("config.armorposition." + name().toLowerCase());
+16
src/client/java/com/armorhud/mixin/client/armorHudMixin.java
··· 29 29 30 30 @Unique private final int FOODBAR_X = 91; 31 31 @Unique private final int HEALTHBAR_X = -10; 32 + @Unique private final int HOTBAR_LEFT_X = -83; 33 + @Unique private final int HOTBAR_RIGHT_X = 165; 32 34 33 35 @Inject(at = @At("TAIL"), method = "renderHotbar") 34 36 private void renderHud(DrawContext context, RenderTickCounter tickCounter, CallbackInfo ci) { ··· 47 49 break; 48 50 case "HEALTHBAR": 49 51 renderArmor(context, HEALTHBAR_X); 52 + break; 53 + case "HOTBAR_LEFT": 54 + renderArmor(context, HOTBAR_LEFT_X); 55 + break; 56 + case "HOTBAR_RIGHT": 57 + renderArmor(context, HOTBAR_RIGHT_X); 50 58 break; 51 59 default: 52 60 renderArmor(context, FOODBAR_X); ··· 108 116 @Unique 109 117 private void moveArmor(DrawContext context) { 110 118 if ( config.position != config.Position.FOODBAR && config.position != config.Position.HEALTHBAR ) { 119 + int scaledHeight = context.getScaledWindowHeight(); 120 + 121 + switch ( config.position.name() ) { 122 + case "HOTBAR_LEFT", "HOTBAR_RIGHT": 123 + armorHeight = scaledHeight - 19; 124 + break; 125 + } 126 + 111 127 return; 112 128 } 113 129