Thanks, unfortunately, this is a client-side only mod.
However, I did manage to resolve my problem using a little bit of reflection.
In case anyone else ever needs it, here's my solution:
@SuppressWarnings("unchecked")
public static List<String> getBossBarNames(Minecraft minecraft) throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException {
GuiBossOverlay bossOverlay = minecraft.ingameGUI.getBossOverlay();
String nameAfter = null;
// Find the name of the field as it will change with each obfuscation of forge
// If you're using this, you'll want to move this lookup elsewhere and store the result
for (Field s : GuiBossOverlay.class.getDeclaredFields()) {
if (s.getType().getName().equals("java.util.Map")) {
nameAfter = s.getName();
break;
}
}
List<String> names = new ArrayList<String>();
if (nameAfter != null) {
Field bossField = GuiBossOverlay.class.getDeclaredField(nameAfter);
bossField.setAccessible(true);
Map<UUID, BossInfoLerping> mapBossInfos = (Map<UUID, BossInfoLerping>) bossField.get(bossOverlay);
for (BossInfoLerping bIL : mapBossInfos.values())
names.add(bIL.getName().getFormattedText());
}
return names;
}