Started by
KingSolomon
on
Topic category: Help with Minecraft modding (Java Edition)
I've been trying to use raytracing blocks to lock on to an entity in the player's field of vision to display it's health, however I can't get it to work. I'd love to just add torohealth to my testing environment but I learned that I would need a deobfuscated version for it to work and can't find it. Is there anyone out there that could help me solve this?
It's going to be a lot more difficult if you want to display the health of the entity as an actual healthbar or something above the entity. (I honestly wouldn't know where to start.)
If you just want to display the current health of an entity though, you can create overlays that indicate the target's healthbar, and have their display conditions be linked to raytracing procedures for the entity the player is looking at. However, this means that the healthbars will be displayed on your screen. (Like the player's healthbar or hungerbar.)
That would be fine, my only issue is I have little to no idea how to use the raytracing blocks that way. Is there an element I'm overlooking that displays mob health because everything I've tried comes up short. Heck I'd be more than happy if I could just set a variable that I could display in an overlay and call it a day just for testing purposes. Can you point me in the right direction?
Btw I meant to send this yesterday, but here's my code so far but it just sends my own HP to the variable: (Google Drive Link: https://drive.google.com/file/d/14aJHBva032RJgUCtUrZTq40v0qvoH1cX/view?usp=sharing)
Never mind I figured it out. I just had to replace the x, y, & z in the "current health of" area to the look position blocks and it works alright for the most part. Thanks!