Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse

LiquidBounce Forum

  1. Home
  2. Kotlin/Java
  3. TargetHUD

TargetHUD

Scheduled Pinned Locked Moved Kotlin/Java
5 Posts 4 Posters 2.4k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • WooShi999W Offline
    WooShi999W Offline
    WooShi999
    wrote on last edited by
    #1

    Still feel ugly...D%NRJP_8VCE$32}O0$~S477.png
    Code:
    package net.ccbluex.liquidbounce.ui.client.hud.element.elements
    import megatron.Client.combat.Aura
    import net.ccbluex.liquidbounce.LiquidBounce
    import net.ccbluex.liquidbounce.ui.client.hud.element.Border
    import net.ccbluex.liquidbounce.ui.client.hud.element.Element
    import net.ccbluex.liquidbounce.ui.client.hud.element.ElementInfo
    import net.ccbluex.liquidbounce.ui.font.Fonts
    import net.ccbluex.liquidbounce.utils.render.Colors
    import net.ccbluex.liquidbounce.utils.render.RenderUtils
    import net.ccbluex.liquidbounce.utils.render.RenderUtils.drawEntityOnScreen
    import net.ccbluex.liquidbounce.value.FloatValue
    import net.ccbluex.liquidbounce.value.FontValue
    import net.minecraft.client.renderer.GlStateManager
    import net.minecraft.entity.Entity
    import net.minecraft.entity.EntityLivingBase
    import net.minecraft.entity.player.EntityPlayer
    import org.lwjgl.opengl.GL11
    import java.awt.Color
    import java.text.DecimalFormat
    import java.text.DecimalFormatSymbols
    import java.util.*
    import kotlin.math.abs
    import kotlin.math.pow
    import kotlin.math.roundToInt
    /**

    • WoShi999 ->target hud like Astolfo
      */
      @ElementInfo(name = "Target")
      class Target : Element() {

      private val decimalFormat = DecimalFormat("##0.00", DecimalFormatSymbols(Locale.ENGLISH))
      private val fontValue = FontValue("Font", Fonts.minecraftFont)
      private val fadeSpeed = FloatValue("FadeSpeed", 2F, 1F, 9F)

      private var easingHealth: Float = 0F
      private var lastTarget: Entity? = null

      override fun drawElement(): Border {
      val target = (LiquidBounce.moduleManager[Aura::class.java] as Aura).target
      if (target is EntityPlayer) {
      if (target != lastTarget || easingHealth < 0 || easingHealth > target.maxHealth ||
      abs(easingHealth - target.health) < 0.01) {
      easingHealth = target.health
      }
      val font=fontValue.get()
      val width = (38 + Fonts.font40.getStringWidth(target.name))
      .coerceAtLeast(118)
      .toFloat()
      RenderUtils.drawBorderedRect(0F, 0F, 120F, 52F, 0F, Color(0,0,0,0).rgb, Color(0,0,0,110).rgb)
      if (easingHealth > target.health)
      RenderUtils.drawRect(2F, 41F, (easingHealth / target.maxHealth) * width,
      49F, Colors.getHealthColor(target).rgb)
      RenderUtils.drawRect(2F, 41F, (target.health / target.maxHealth) * width,
      49F,Colors.getHealthColor(target).rgb)
      Fonts.minecraftFont.drawString(target.name, 37, 3, 0xffffff)
      easingHealth += ((target.health - easingHealth) / 2.0F.pow(10.0F - fadeSpeed.get())) * RenderUtils.deltaTime
      val playerInfo = mc.netHandler.getPlayerInfo(target.uniqueID)
      if (playerInfo != null) {
      GL11.glPushMatrix()
      GL11.glScalef(2F,2F,2F)
      font.drawString("${getHealth2(target).roundToInt()} ❤", 19,9,Colors.getHealthColor(target).rgb)
      GL11.glPopMatrix()
      } // Draw player
      GlStateManager.resetColor()
      drawEntityOnScreen(19,40,20,target)
      }
      lastTarget = target
      return Border(0F, 0F, 130F, 45F)
      }
      private fun getHealth2(entity: EntityLivingBase?):Float{
      return if(entity==null || entity.isDead){ 0f }else{ entity.health }
      }
      }

    ? 1 Reply Last reply
    1
    • WooShi999W WooShi999

      Still feel ugly...D%NRJP_8VCE$32}O0$~S477.png
      Code:
      package net.ccbluex.liquidbounce.ui.client.hud.element.elements
      import megatron.Client.combat.Aura
      import net.ccbluex.liquidbounce.LiquidBounce
      import net.ccbluex.liquidbounce.ui.client.hud.element.Border
      import net.ccbluex.liquidbounce.ui.client.hud.element.Element
      import net.ccbluex.liquidbounce.ui.client.hud.element.ElementInfo
      import net.ccbluex.liquidbounce.ui.font.Fonts
      import net.ccbluex.liquidbounce.utils.render.Colors
      import net.ccbluex.liquidbounce.utils.render.RenderUtils
      import net.ccbluex.liquidbounce.utils.render.RenderUtils.drawEntityOnScreen
      import net.ccbluex.liquidbounce.value.FloatValue
      import net.ccbluex.liquidbounce.value.FontValue
      import net.minecraft.client.renderer.GlStateManager
      import net.minecraft.entity.Entity
      import net.minecraft.entity.EntityLivingBase
      import net.minecraft.entity.player.EntityPlayer
      import org.lwjgl.opengl.GL11
      import java.awt.Color
      import java.text.DecimalFormat
      import java.text.DecimalFormatSymbols
      import java.util.*
      import kotlin.math.abs
      import kotlin.math.pow
      import kotlin.math.roundToInt
      /**

      • WoShi999 ->target hud like Astolfo
        */
        @ElementInfo(name = "Target")
        class Target : Element() {

        private val decimalFormat = DecimalFormat("##0.00", DecimalFormatSymbols(Locale.ENGLISH))
        private val fontValue = FontValue("Font", Fonts.minecraftFont)
        private val fadeSpeed = FloatValue("FadeSpeed", 2F, 1F, 9F)

        private var easingHealth: Float = 0F
        private var lastTarget: Entity? = null

        override fun drawElement(): Border {
        val target = (LiquidBounce.moduleManager[Aura::class.java] as Aura).target
        if (target is EntityPlayer) {
        if (target != lastTarget || easingHealth < 0 || easingHealth > target.maxHealth ||
        abs(easingHealth - target.health) < 0.01) {
        easingHealth = target.health
        }
        val font=fontValue.get()
        val width = (38 + Fonts.font40.getStringWidth(target.name))
        .coerceAtLeast(118)
        .toFloat()
        RenderUtils.drawBorderedRect(0F, 0F, 120F, 52F, 0F, Color(0,0,0,0).rgb, Color(0,0,0,110).rgb)
        if (easingHealth > target.health)
        RenderUtils.drawRect(2F, 41F, (easingHealth / target.maxHealth) * width,
        49F, Colors.getHealthColor(target).rgb)
        RenderUtils.drawRect(2F, 41F, (target.health / target.maxHealth) * width,
        49F,Colors.getHealthColor(target).rgb)
        Fonts.minecraftFont.drawString(target.name, 37, 3, 0xffffff)
        easingHealth += ((target.health - easingHealth) / 2.0F.pow(10.0F - fadeSpeed.get())) * RenderUtils.deltaTime
        val playerInfo = mc.netHandler.getPlayerInfo(target.uniqueID)
        if (playerInfo != null) {
        GL11.glPushMatrix()
        GL11.glScalef(2F,2F,2F)
        font.drawString("${getHealth2(target).roundToInt()} ❤", 19,9,Colors.getHealthColor(target).rgb)
        GL11.glPopMatrix()
        } // Draw player
        GlStateManager.resetColor()
        drawEntityOnScreen(19,40,20,target)
        }
        lastTarget = target
        return Border(0F, 0F, 130F, 45F)
        }
        private fun getHealth2(entity: EntityLivingBase?):Float{
        return if(entity==null || entity.isDead){ 0f }else{ entity.health }
        }
        }

      ? Offline
      ? Offline
      A Former User
      wrote on last edited by
      #2

      @wooshi999 That's not ugly

      END3R1355E 1 Reply Last reply
      0
      • ? A Former User

        @wooshi999 That's not ugly

        END3R1355E Offline
        END3R1355E Offline
        END3R1355
        wrote on last edited by
        #3

        @mimikyuin is it me or does the targethud look like astolfo client's?

        Plumer ManP 1 Reply Last reply
        0
        • END3R1355E END3R1355

          @mimikyuin is it me or does the targethud look like astolfo client's?

          Plumer ManP Offline
          Plumer ManP Offline
          Plumer Man
          wrote on last edited by
          #4

          @end3r1355 It is an attempt at making astolfo targethud

          END3R1355E 1 Reply Last reply
          0
          • Plumer ManP Plumer Man

            @end3r1355 It is an attempt at making astolfo targethud

            END3R1355E Offline
            END3R1355E Offline
            END3R1355
            wrote on last edited by
            #5

            @plumer-man kewl

            1 Reply Last reply
            0

            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

            With your input, this post could be even better 💗

            Register Login
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            About
            • Terms of Service
            • Privacy Policy
            • Status
            • Contact Us
            Downloads
            • Releases
            • Source code
            • License
            Docs
            • Tutorials
            • CustomHUD
            • AutoSettings
            • ScriptAPI
            Community
            • Forum
            • Guilded
            • YouTube
            • Twitter
            • D.Tube
            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups