How to modify the maximum hunger and thirst value of qbcore

Hello, everyone, I am a newbie in qbcore. I would like to ask you how to modify it? I always feel that 100 is too little for the maximum hunger and thirst values of qbcore, and I need to modify it. What is a good way? Thanks, I need help please tell me, what should I do. I think 100 is not enough, I will be full after eating a few foods. If you know how to do it, please tell me, thank you very much

I’m not sure that’s even possible. Approach it from the other direction - change the amount of “hunger” gained by eating food etc

You can’t increase the maximum amount, but you can slow the decay rate inside the main config file for qb-core.

NOTE: Server has to be restarted after changes to apply these settings.

1 Go to “resources/[qb]/qb-core/config.lua”
2. Look for these 2 lines
“QBConfig.Player.HungerRate”
“QBConfig.Player.ThirstRate”
3. Adjust the Rates to your liking…
example:
my thirst is set to “1.0” and it takes 1hour40minutes to pass out
my hunger is set to “0.5” and it takes over 3 hours to pass out

1 Like

I dont knwo you must try it.

in qb-core/server/player.lua

you can try to edit this

PlayerData.metadata[‘hunger’] = PlayerData.metadata[‘hunger’] or 100
PlayerData.metadata[‘thirst’] = PlayerData.metadata[‘thirst’] or 100

maybe you can change it :slight_smile:

These two lines are meant for the SQL Database when loading your character, I wouldn’t change these variables.

it is essentially saying that “player hunger is equal to the stored hunger data in the SQL, and if there is no data stored, it should equal 100”

I think the hunger value can be changed. It’s not like he doesn’t have a place, he must have it, but he just hasn’t found it.

does anyone know how to change the eating speed ??

Eating speed is dictated by the “progressbar” function

how to turn it off at all?

you can find it in “resources/[qb]/qb-core/config.lua”
change the variables to 0.0 as shown below…

QBConfig.Player.HungerRate = 0.0 -- Rate at which hunger goes down.
QBConfig.Player.ThirstRate = 0.0 -- Rate at which thirst goes down.

server will need to restart for the changes to take effect.
once it is changed, just eat some food and drink some water until your are at maximum for both, and then the hunger and thirst will not increase.

1 Like