eva08maicy02 Posted April 29, 2022 Share Posted April 29, 2022 (edited) I want to create a drink and get a Glass Tumbler and a straw when the drink is done. I know ReplaceOnUse, but it seems to only can set one item, how do I set two? I tried setting two ReplaceOnUse and it only worked one; I tried "ReplaceOnUse = GlassTumbler;straw," and it makes the item all-you-can-drink; Maybe OnCreate also works on items? So I tried doing it on items, but it didn't work. Does anyone know how to implement it? Or know of any mod that implements it, I'd like to refer to it. Edited April 30, 2022 by eva08maicy02 (Solved) Link to comment Share on other sites More sharing options...
Hugo Qwerty Posted April 29, 2022 Share Posted April 29, 2022 On possible way is to use the OnEat proprty: For example, vanilla cigarettes uses: OnEat = OnEat_Cigarettes, OnEat_Cigarettes is a function that deals with happiness / stress changes from smoking. You could write your own function to just add the two items to the player's inventory, although you might need to check that the food has been completely consumed to prevent the player getting the items every time they drink 1/4 of it. Alternatively, you could create a 'TumblerAndStraw' item and return that from ReplaceOnUse, and use that in the create recipe (and create a recipe to to make a TumblerAndStraw from the two items). eva08maicy02 1 Link to comment Share on other sites More sharing options...
eva08maicy02 Posted April 30, 2022 Author Share Posted April 30, 2022 17 hours ago, Hugo Qwerty said: On possible way is to use the OnEat proprty: For example, vanilla cigarettes uses: OnEat = OnEat_Cigarettes, OnEat_Cigarettes is a function that deals with happiness / stress changes from smoking. You could write your own function to just add the two items to the player's inventory, although you might need to check that the food has been completely consumed to prevent the player getting the items every time they drink 1/4 of it. Alternatively, you could create a 'TumblerAndStraw' item and return that from ReplaceOnUse, and use that in the create recipe (and create a recipe to to make a TumblerAndStraw from the two items). Since I don't know anything about functions, I'm glad I can use the second method to solve this problem: make them a set of dirty dishes, then make the recipe to wash them, use OnCreate to separate them. Your reply helped me a lot, thank you very much Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now