Is there any working Boss Bar API?

Discussion in 'Plugin Development' started by T0pAz7, Apr 12, 2015.

Thread Status:
Not open for further replies.
  1. Offline


    All the ones I use have the problem of the bar dissapearing. I know it's due to how you face the ender dragon and I tried to create my own Boss Bar API. But I don't understand how to spawn an invisible boss per player and teleport it based on the player's location and change the bar text and value. I know you have to use reflection for it but I don't know how to start spawning them and storing their entity on map to teleport them frequently.
  2. Offline


    The bar dissapearing is a client side bug. It is impossible to fix.
  3. Offline


    @T0pAz7 I had the same problem and had to rewrite the thing. I discovered by modding my client the way big servers such as Hypixel do it: they place the wither/dragon right in front of your cursor, 40 blocks away (in the case of Hypixel). This will fix the problem of the bar disappearing, except if you place the boss deep into blocks (with the cursor). In other words, if I am at the surface and look straight down, there will be 40 layers of blocks between the boss and I, which will remove the bar until the boss gets out of there. This can be fixed by removing the stone and leaving the space hollow. Concerning the packets, it's really simple:

    1. Create a new Entity (not Bukkit one, NMS Entity).
    2. Send a PacketPlayOutSpawnEntityLiving to the player.
    3. Send a PacketPlayOutEntityMetadata to the player (check the source of BarAPI)
    4. Send a PacketPlayOutEntityTeleport n times per second to update the location of the boss.
    5. Send a PacketPlayOutEntityDestroy to remove the entity.

    This page might help you with packets.
    T0pAz7 and ItsMattHogan like this.
  4. Offline


    Seems like a good idea. Is there a way to disable the collision. The boss is blocking some of the arrows.
  5. Offline


    I don't understand how it could block arrows since it's fake? Is the client predicting the path of the arrow? Even if it is, and you place the boss 40 blocks away, how will the player ever be able of shooting it, especially with minecraft bows? Taken in consideration he will also not be able to see it, it'd take a lot of luck to just hit the boss.
Thread Status:
Not open for further replies.

Share This Page