Jump to content

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


NindyBun

Recommended Posts

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 :(

Link to comment
Share on other sites

  • 1 month later...
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

Link to comment
Share on other sites

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...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

Important Information

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