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 understand the base of how to acquire the player's FoodStats, but I would like to know how it works. Does FoodStats#addExaustion() affect it's drain speed? Or is there a better way of doing this? I simple example would be very helpful.

I am not a cat. I know my profile picture is sexy and amazing beyond anything you could imagine but my cat like features only persist in my fierce eyes. I might be a cat.

Kind of. For my own purposes, adding exhaustion was sufficient, as once that reaches 0, hunger begins to deplete, and adding more exhaustion will deplete the hunger bar directly.

 

So if you wanted a faster hunger bar drain, you could add 0.1F exhaustion (or however much) every so often and it would basically have the effect you want.

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

Thank you both, I realized I was on peaceful when testing, so the hunger bar wouldn't deplete. :P I do have a question about the implementation though: I use it in the #LivingUpdateEvent, and was wondering how I could do this with my weight variable. Should I create a timer that is affected by the player's current weight? Or do some math in order to determine how much exhaustion to add with the weight?

I am not a cat. I know my profile picture is sexy and amazing beyond anything you could imagine but my cat like features only persist in my fierce eyes. I might be a cat.

Well that depends: how do you want it to work? Either way you'll be doing math, and either way there should be a timer of some sort involved or else the player's hunger will go down pretty darn quick.

 

Btw, why use LivingUpdateEvent when the only ones with hunger are players? This is what PlayerTickEvent is for.

  • Author

Most of my update has been in LivingUpdate, will switch over here soon. My only problem is creating a timer within an update event. Seems the timer will always be reset, which is not what someone wants at all. Even though this is basic java, could you give an example on how I would start with a timer in a tick event?

I am not a cat. I know my profile picture is sexy and amazing beyond anything you could imagine but my cat like features only persist in my fierce eyes. I might be a cat.

Or put it in player's IEEP if you need separate timer.

1.7.10 is no longer supported by forge, you are on your own.

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.