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'm trying to hide the hunger bar. I've done the same with the renderHealth, and works properly, but for some reasons doesn't work with the hunger bar.

This is the method called in a LivingUpdateEvent

public static void HideHungerBar(EntityPlayer player) {
	if (player.getFoodStats().getFoodLevel() >= Properties.Hud.hideHungerBarThreshold)
	{
		GuiIngameForge.renderFood = false;
	}
}

Using the logger I know that the game enter in the method, and placing a log for renderFood before GuiIngameForge.renderFood = false will return true before and false after, but the bar doesn't disappear.

 

ForgeVersion: 14.23.0.2545

  • Author
On 15/1/2018 at 4:02 PM, diesieben07 said:
  • To disable/enable HUD elements dynamically (not permanently) you need to use RenderGameOverlayEvent.Pre, not the static fields in GuiIngameForge.

Does RenderGameOverlayEvent run every frame and not every tick? I'm the bar should hide after 5 seconds but the timer increases at crazy speed and hides after less than 1 sec

Edited by Insane96MCP

4 hours ago, Insane96MCP said:

Does RenderGameOverlayEvent run every frame and not every tick? I'm the bar should hide after 5 seconds but the timer increases at crazy speed and hides after less than 1 sec

Yes, it runs every frame, not every tick. Rendering must always happen every frame.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

world#getWorldTime

world#getTotalWorldTime

And one other I can't remember the name of at the moment. One tells you the game's "date" (non-resetting value that increments by 1 tick per tick and is modified by the /time command) the other gets you the curernt "time" (midnight to midnight) and another gets you how long the world has existed (1 tick per tick, does not get modified by sleeping or /time).

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

  • Author
18 hours ago, Draco18s said:

world#getWorldTime

world#getTotalWorldTime

And one other I can't remember the name of at the moment. One tells you the game's "date" (non-resetting value that increments by 1 tick per tick and is modified by the /time command) the other gets you the curernt "time" (midnight to midnight) and another gets you how long the world has existed (1 tick per tick, does not get modified by sleeping or /time).

Thanks a lot. World.getTotalWorldTime() and a subtraction did the job.

 

5 hours ago, diesieben07 said:

Note that these will pause when you pause the game. If you truly want a 5-second fade-out, you need to count ticks (or use System.currentTimeMillis).

Not a problem in my case.

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.