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

I would like to know a way to use the RenderGameOverlayEvent to render something similar to what a pumpkin does (i.e. render's the pumpkin blur overlay on screen but BEHIND all the HUD things).

I've tried .Post and .Pre for ElementType of HELMET, ALL and some of the hud stuff, such as EXPERIENCE.

If I do .Pre, it renders correctly (my overlay), BUT all the HUD stuff disappears.

If I do .Post, it renders correctly, but it renders ABOVE the HUD stuff (i.e. I have a semi-white texture and all the HUD stuff gains the effect of the texture).

Does anyone know any way to achieve what I require?

ย 

Thanks in advance.

Have you tried changing the zLevel at which you render? If your render code is affecting the vanilla rendering, you need to make sure that you disable/re-enable whatever settings you changed in openGL; for example, if you enable BLEND, be sure to disable it when you finish rendering.

Pumpkin dont render in game overlay...there is function for that in Item class , for rendering stuff if you armor is equiper on player.

ย  ย  /**
ย  ย   * Called when the client starts rendering the HUD, for whatever item the player currently has as a helmet. 
ย  ย   * This is where pumpkins would render there overlay.
ย  ย   *ย  
ย  ย   * @param stack The ItemStack that is equipped
ย  ย   * @param player Reference to the current client entity
ย  ย   * @param resolution Resolution information about the current viewport and configured GUI Scale
ย  ย   * @param partialTicks Partial ticks for the renderer, useful for interpolation
ย  ย   * @param hasScreen If the player has a screen up, which will be rendered after this.
ย  ย   * @param mouseX Mouse's X position on screen
ย  ย   * @param mouseY Mouse's Y position on screen
ย  ย   */
ย  ย  @SideOnly(Side.CLIENT)
ย  ย  public void renderHelmetOverlay(ItemStack stack, EntityPlayer player, ScaledResolution resolution, float partialTicks, boolean hasScreen, int mouseX, int mouseY){}

  • Author

Have you tried changing the zLevel at which you render? If your render code is affecting the vanilla rendering, you need to make sure that you disable/re-enable whatever settings you changed in openGL; for example, if you enable BLEND, be sure to disable it when you finish rendering.

ย 

I'll try that Alias, thank you. I'll play around with it abit first and then report back as to if it worked, in case you want to use it yourself.

  • Author

Have you tried changing the zLevel at which you render? If your render code is affecting the vanilla rendering, you need to make sure that you disable/re-enable whatever settings you changed in openGL; for example, if you enable BLEND, be sure to disable it when you finish rendering.

Pumpkin dont render in game overlay...there is function for that in Item class , for rendering stuff if you armor is equiper on player.

ย  ย  /**
ย  ย   * Called when the client starts rendering the HUD, for whatever item the player currently has as a helmet. 
ย  ย   * This is where pumpkins would render there overlay.
ย  ย   *ย  
ย  ย   * @param stack The ItemStack that is equipped
ย  ย   * @param player Reference to the current client entity
ย  ย   * @param resolution Resolution information about the current viewport and configured GUI Scale
ย  ย   * @param partialTicks Partial ticks for the renderer, useful for interpolation
ย  ย   * @param hasScreen If the player has a screen up, which will be rendered after this.
ย  ย   * @param mouseX Mouse's X position on screen
ย  ย   * @param mouseY Mouse's Y position on screen
ย  ย   */
ย  ย  @SideOnly(Side.CLIENT)
ย  ย  public void renderHelmetOverlay(ItemStack stack, EntityPlayer player, ScaledResolution resolution, float partialTicks, boolean hasScreen, int mouseX, int mouseY){}

ย 

Thank you to both of you for your help. It now works. I took coolAlias's advice on re-verting everything I changed in GL11, and I used the reference to the pumpkin overlay from TechoMan to help me reproduce the overlay code. All I did was take the code from the pumpkin overlay and stick it in the RenderGameOverlayEvent.Post, with the ElemenType checked for as HELMET.

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.