Is there a way to make an Infinite Food Item (fabric)?

Started by ButterKing-28 on

Topic category: Help with modding (Java Edition)

Last seen on 18:11, 30. Jun 2023
Joined Mar 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Is there a way to make an Infinite Food Item (fabric)?

Hello!
I am trying to make an item that does not have a decrement when it is eaten and stays in your inventory (so it does not have any decrement). I tried to make a custom item, and it doesn't let you eat it because I think the way I did it just makes it un-edible because It sets the decrement to 0 when it is right-clicked.

Can someone help me figure out how to do it? 
Thank you so much!
ButterKing-28

Last seen on 05:53, 27. Aug 2023
Joined Mar 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I'm not sure to understand…
Wed, 05/31/2023 - 18:11

I'm not sure to understand correctly : You want that for example if you have 64 food in you hand and you eat one, you have still 64 at the end ?

 

In this case, can't you create a procedure that say something like "when food is eaten, add 1 food to player inventory" ?
To avoid problems like your food appear in an other slot, you can create a variable that register the number of items in the main hand when start eating, and when eaten, set the items of the main hand to the variable.