Jump to content

How to make an item be able to be eaten


Rob Boss

Recommended Posts

Call the food method on your item's properties, and give it a FoodProperties. Either use a FoodProperties from vanilla's Foods class or make your own the same way they do there, e.g.

new Item.Properties().food((new FoodProperties.Builder()).nutrition(5).saturationMod(0.5f).build())

In the future, if you want to work out how to add more properties to an item, go to vanilla's Items class and look for an item that has the desired properties (e.g. bread in this case) and follow how it is done there.

Link to comment
Share on other sites

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.

Announcements



×
×
  • Create New...

Important Information

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