Jump to content

[SOLVED] Client side mod to monitor player's hunger


Is.M.L

Recommended Posts

I want my mod to type /feed automatically once hunger reaches a certain point. It's meant for a multiplayer server, so it must be client side. I don't suppose the client gets any events I can handle. What is the best way of implementing this feature?

Edited by Is.M.L
mark solved
Link to comment
Share on other sites

You'll need to monitor the food stats on ClientTickEvent, since there aren't any events fired on the client when the food stats change.

 

Make sure you check the event's Phase to avoid running your code twice per tick.

  • Like 1

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Link to comment
Share on other sites

13 hours ago, Choonster said:

You'll need to monitor the food stats on ClientTickEvent, since there aren't any events fired on the client when the food stats change.

 

Make sure you check the event's Phase to avoid running your code twice per tick.

Works perfectly thank you very much

Link to comment
Share on other sites

  • 2 months later...

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...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.