CCBlueX Forum

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups

    A Form to show your own player‘s imformation

    Kotlin/Java
    3
    3
    236
    Loading More Posts
    • 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.
    • Larissa
      Larissa last edited by

      it is coded for chinese,if you want to get different language you can change it

      
      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.RenderUtils
      import net.minecraft.client.gui.Gui
      import net.minecraft.client.renderer.GlStateManager
      import net.minecraft.util.ResourceLocation
      import org.lwjgl.opengl.GL11
      import java.awt.Color
      
      @ElementInfo(name = "ShowPlayerInformation")
      class ShowPlayerInformation : Element() {
          override fun drawElement(): Border {
              RenderUtils.drawBorderedRect(0F, -20F, 142F, 35F, 2F, Color(40,40,40,240).rgb, Color(20, 20, 20, 60).rgb)
              RenderUtils.drawBorderedRect(0F, -20F, 142F, 35F, 0.5F, Color(255,255,255,120).rgb, Color(255, 180, 255, 0).rgb)
              RenderUtils.drawBorderedRect(0F, -10F, 142F, 35F, 2F, Color(40,40,40,240).rgb, Color(255, 190, 255, 0).rgb)
              RenderUtils.drawBorderedRect(0F, -10F, 142F, 35F, 0.5F, Color(255,255,255,120).rgb, Color(255, 180, 255, 0).rgb)
              var BpsFloat = Math.sqrt(Math.pow(mc.thePlayer!!.posX - mc.thePlayer!!.prevPosX, 2.0) + Math.pow(mc.thePlayer!!.posZ - mc.thePlayer!!.prevPosZ, 2.0)) * 20 * mc.timer.timerSpeed
              var BpsDouble = (BpsFloat * 100 - (BpsFloat * 100) % 1) / 100
              GL11.glPushMatrix()
              GL11.glEnable(GL11.GL_BLEND)
              GL11.glDisable(GL11.GL_TEXTURE_2D)
              GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA)
              GL11.glEnable(GL11.GL_LINE_SMOOTH)
              GL11.glDisable(GL11.GL_CULL_FACE)
              GL11.glShadeModel(7425)
      
              GL11.glBegin(GL11.GL_POLYGON)
      
              GlStateManager.color(20 / 255f, 20 / 255f, 20 / 255f, 185 / 255f)
              GL11.glVertex2d(0f.toDouble(), (-10f).toDouble())
              GL11.glVertex2d(142f.toDouble(), (-10f).toDouble())
              GlStateManager.color(20 / 255f, 20 / 255f, 20 / 255f,20 / 255f)
              GL11.glVertex2d(142f.toDouble(), 37f.toDouble())
              GL11.glVertex2d(0f.toDouble(), 37f.toDouble())
              GL11.glEnd()
      
              GL11.glShadeModel(7424)
              GL11.glEnable(GL11.GL_TEXTURE_2D)
              GL11.glEnable(GL11.GL_CULL_FACE)
              GL11.glDisable(GL11.GL_BLEND)
              GL11.glDisable(GL11.GL_LINE_SMOOTH)
              GL11.glPopMatrix()
      
              Fonts.font35.drawString("本玩家展示栏目表",35f , -18f, Color.WHITE.rgb)
              Fonts.font35.drawString("信息:", 5f, -5f, Color.WHITE.rgb)
              Fonts.font35.drawString("头:", 85f, -5f, Color.WHITE.rgb)
      
              Fonts.fontRegular35.drawString("  名字: " + mc.thePlayer.name, 0.5f, 5f, Color(255, 255, 255, 200).rgb, shadow = true)
              Fonts.fontRegular35.drawString("  速度: ${BpsDouble} Bps", 0.5F, 15F, Color(255, 255, 255, 200).rgb, shadow = true)
              Fonts.fontRegular35.drawString("  等级: " + mc.thePlayer.experienceLevel + " " + "级", 0.5f, 25f, Color(255, 255, 255, 200).rgb, shadow = true)
              drawHead(skin = mc.thePlayer.locationSkin, width = 40, height = 40);
              return Border(0F, 0f, 142F,  35F)
          }
          private fun drawHead(skin: ResourceLocation, width: Int, height: Int) {
              GL11.glColor4f(1F, 1F, 1F, 1F)
              mc.textureManager.bindTexture(skin)
              Gui.drawScaledCustomSizeModalRect(99, -8, 8F, 8F, 8, 8, width, height,
                      64F, 64F)
          }
      }
      /*
      * @Coder Larissa
      * welcome to use
      * */
      
      

      3F84AD22-C0D5-4F58-824D-7FFA76E3C909.png

      kumri owo 1 Reply Last reply Reply Quote 6
      • kumri owo
        kumri owo @Larissa last edited by

        @larissa Nice!

        1 Reply Last reply Reply Quote 0
        • T
          TaffyPoole last edited by

          so good!!

          1 Reply Last reply Reply Quote 0
          • First post
            Last post
          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