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.

[1.16.5] How to use DrawHighlightEvent or GLStateManager to highlight an area of blocks where the player is looking at?

Featured Replies

Posted

As the title suggests, I want to somehow highlight or visually show an area of blocks around the place the player is looking at. I heard I can use DrawBlockHighlightEvent and/or GLStateManager but how would I go about doing so?

For 1.16.5 you can check out this example code here:

https://github.com/TheGreyGhost/MinecraftByExample/blob/master/src/main/java/minecraftbyexample/usefultools/debugging/DebugBlockVoxelShapeHighlighter.java

From what I understand it basically cancels DrawBlockHighlightEvent and then goes on to write what the event would do in the first place so that you can adjust its parameters. If you want to change the block to be highlighted for example, you can change the BlockPos variable to whatever coordinate you want. Keep it mind it only ever highlights the wireframe, not the block faces themselves.

If you ever manage to get this working in 1.17.1 please tell me! I've been stuck on this issue for a while :(

  • 1 month later...
  • Author
On 12/29/2021 at 2:08 PM, SoLegendary said:

For 1.16.5 you can check out this example code here:

https://github.com/TheGreyGhost/MinecraftByExample/blob/master/src/main/java/minecraftbyexample/usefultools/debugging/DebugBlockVoxelShapeHighlighter.java

From what I understand it basically cancels DrawBlockHighlightEvent and then goes on to write what the event would do in the first place so that you can adjust its parameters. If you want to change the block to be highlighted for example, you can change the BlockPos variable to whatever coordinate you want. Keep it mind it only ever highlights the wireframe, not the block faces themselves.

If you ever manage to get this working in 1.17.1 please tell me! I've been stuck on this issue for a while :(

https://github.com/NindyBun/BurnerGun_1.16.5-3.0.0/blob/master/src/main/java/com/nindybun/burnergun/client/renderer/BlockRenderer.java I just did it this way and it works much better

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.