Jump to content

Craftiii4

Members
  • Posts

    6
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Craftiii4

  1. Was experimenting with the boss related classes trying to get the output out I wanted, so granted it's not the best reflection ever written. I'll modify my above code to reflect the changes suggested, thanks again!
  2. By on server I meant that the boss bar is on the server, e.g. "Welcome to thisserver.com" Thanks for the tips, I do only look up field once, just modified it slightly before I added the code here so it would work as a standalone function.
  3. 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; }
  4. Hey, I'm trying to extract information out of a boss bar on a server. However, there doesn't seem to be any entities in the world which could be the boss. How would I go about extracting this information without the entity? Thanks in advance
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.