Jump to content

Recommended Posts

So I want to make a recipe for the "rocks" item for my mod character (just regular rocks that you mine from a boulder), and instead of ingredients I want my character to lose 5 health whenever he crafts one. I'm guessing this has a similar code as the Telltale Heart item, but I'm really bad at coding and I'm not sure how to make this to work properly so if anyone could help I would be grateful.

You can use the AddCharacterRecipe function in modmain to add a custom recipe, including to pre-existing prefabs.

Tutorial for using said function here:

For using health as an ingredient, you can use GLOBAL.CHARACTER_INGREDIENT.HEALTH, like follows as an example:

AddCharacterRecipe("rocks",
  {	Ingredient(GLOBAL.CHARACTER_INGREDIENT.HEALTH, 5) },
  --...Rest of Recipe here

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...