Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

Hello, sometime ago I asked help on this same thing and I figured something out, but the method I'm using is coming with a few problems. Foremost, it entirely breaks when using Optifine Shaders (I used the internal ones). And second of all, while it does render text the exact way I want it to, it doesn't have the transparent background like entity names would. Is there any better way to achieve what I'm trying to achieve? (This is all client side)

Here is my current function: (I call it in RenderWorldLastEvent)

protected void renderNameTag(MathUtils.Point pos, ITextComponent text, MatrixStack ms, IRenderTypeBuffer buffer, float partialTicks, float yOffset) {
        Minecraft mc = Minecraft.getInstance();
        int combinedLightIn = mc.getEntityRenderDispatcher().getPackedLightCoords(mc.player, partialTicks);
        ms.pushPose();
        ms.translate(pos.getX(), yOffset, pos.getY());
        Quaternion q = mc.getEntityRenderDispatcher().cameraOrientation();
        ms.mulPose(q);
        ms.scale(-0.025F, -0.025F, 0.025F);
        Matrix4f matrix4f = ms.last().pose();
        float opacity = Minecraft.getInstance().options.getBackgroundOpacity(0.5F);
        int alpha = (int)(opacity * 255.0F) << 24;
        FontRenderer fontrenderer = Minecraft.getInstance().getEntityRenderDispatcher().getFont();
        float width = (float)(-fontrenderer.width(text) / 2);
        //fontrenderer.drawInBatch(text, f2, i, 553648127, false, matrix4f, buffer, false, j, p_225629_5_);

        //fontrenderer.drawInBatch(text, width, 0f, 553648127, false, matrix4f, buffer, false, alpha, combinedLightIn);
        fontrenderer.drawInBatch(text, width, 0f, -1, false, matrix4f, buffer, true, 0, combinedLightIn);

        ms.popPose();
    }

If you need any additional information, please ask.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.