Jump to content

Character won't eat custom food


Recommended Posts

Hi, I'm new to modding but I know a bit of lua.

I'm trying to make a character named Fluffy, a magic teddy bear who only eats magic gems. I've been trying for a while, and it's stopped crashing but the character won't eat the healing gem, they just inspect it. How do I make them eat the gem?

 

In my character file:

inst.components.eater:SetDiet({ FOODGROUP.OMNI }, {FOODTYPE.GEMS, FOODTYPE.GOODIES })

inst.components.eater.foodprefs={FOODTYPE.GEMS}

 

In my item file

inst:AddComponent("edible")
    inst.components.edible.foodtype = "GEMS"
    inst.components.edible.healthvalue = 50
    inst.components.edible.hungervalue = -50
    inst.components.edible.sanityvalue = 0
 

Thanks in advance.

 

Link to comment
Share on other sites

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
 Share

×
  • Create New...