Started by
Charge Cannons
on
Topic category: Help with Minecraft modding (Java Edition)
I was wondering if there was a way to add a favorite food to a custom mob. An example would be the goblin I coded, I want its favorite food to be an apple and when it would take damage from either fall damage, player, or other hostile mobs it would eat the apple to heal itself.
So, it takes out an item and heals itself? Does it use the Biped or Zombie model?
I doubt you can display the mob eating the apple like Witches drink potions without coding, but you could still make the player be able to feed the mob to heal it
(you'll have to use the user/target dependencies which were added recently, but since I am still using 2020.2 I can't help you with this :()
It uses biped
If it's biped you could set an apple in its hand while it's eating and maybe also swing its arm once, but I'm not sure if would it work
You could have an nbt variable which is a timer that goes down every tick until the mob stops eating, then the mob's health is restored and the apple is removed from the hand.
If you need further explanation I could write here a procedure example
Hi, thank you. Could you give a procedure example