hey, i want to slow down player hunger/exhaustion, for example make certain players lose hunger 2 times slower than normal, so that food lasts longer.
How should i do this? Should i use player exhaustion level increases, and cancel every-other one?
the docs warn that the event fires very rapidly, should i or could i do something else instead?
#(Blockutis) slowing down player hunger / exhaustion
26 messages · Page 1 of 1 (latest)
(Blockutis) slowing down player hunger / exhaustion
Hi I'm AutoThreadBot! Don't mind me, I'll just be adding the helper team to this thread so they can see it. A human will get to you soon.
You can block this bot if you don't want to see these messages, I won't mind.
<@&525394568410038282>
!e food
Group
Entity
Event Lines
<entity> changes food level
Switches
item:<item> to only process the event if it was triggered by an item that matches the specified item.
Triggers
when an entity's food level changes.
Has Player
when the entity that's food level has changed is a player. - this adds switches flagged:<flag name> + permission:<node>, in addition to the <player> link.
Has NPC
when the entity that's food level has changed is an NPC.
Context
<context.entity> returns the EntityTag.
<context.food> returns an ElementTag(Number) of the entity's new food level.
<context.item> returns an ItemTag of the item that triggered the event, if any.
Determine
ElementTag(Number) to set the entity's new food level.
Has Known Location
True - this adds switches in:<area> + location_flagged:<flag name>.
Cancellable
True - this adds <context.cancelled> and determines cancelled + cancelled:false.
!t food_level
!t PlayerTag.food_level
Returns the current food level (aka hunger) of the player.
Returns
ElementTag(Number)
Mechanism
PlayerTag.food_level
you can use that event
it also fires when the food goes up, so you want an if check to make sure the code only runs if the food is going down
how can i check if the food went up or down?
save the value of current food_level inside a flag, and then in the next event trigger do logic accordingly
alright. For now i just check if an item was used to cause the change, if not, it must have gone down
if that doesnt work, ill do what you said
true, i dont think you can heal hunger without items if not by a plugin/command
Are you sure getting their current food level in an on event wouldn't return their pre-change food level?
It would
No need for flag
Just compare playertag.food_level with context.food
damn. i've got to re learn denizen 🥲
Thread Closing Reminder
Has your issue been resolved, or your question been answered?
If so, please use the </resolved:1028673926114594866> command to close your thread.
Or </invalid:1028673926898909185> if it's not possible to resolve.
If not yet resolved, please reply below to tell us what you still need.
(Note that if there is no reply for a few days, this thread will eventually close itself.)
@viscid ingot
thanks