Custom mob favorite food and self-healing

Started by Charge Cannons on

Topic category: Help with Minecraft modding (Java Edition)

Joined Jun 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Custom mob favorite food and self-healing

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.

Joined Jan 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
So, it takes out an item and…
Wed, 07/01/2020 - 15:35

So, it takes out an item and heals itself? Does it use the Biped or Zombie model?

Joined Jun 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I doubt you can display the…
Wed, 07/01/2020 - 15:40

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 :()

Joined Jun 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
If it's biped you could set…
Sat, 07/04/2020 - 12:59

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

Joined Jun 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Hi, thank you. Could you…
Mon, 07/06/2020 - 15:08

Hi, thank you. Could you give a procedure example