Custom mob favorite food and self-healing

Started by Charge Cannons on

Topic category: Help with Minecraft modding (Java Edition)

Active 4 years ago
Joined Jun 2020
Points:
588

User statistics:

  • Modifications: 0
  • Forum topics: 1
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 3
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.

Active 3 years ago
Joined Jan 2020
Points:
822

User statistics:

  • Modifications: 1
  • Forum topics: 20
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 203
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?

Active 3 years ago
Joined Jun 2016
Points:
3742

User statistics:

  • Modifications: 10
  • Forum topics: 39
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 5492
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 :()

Active 4 years ago
Joined Jun 2020
Points:
588

User statistics:

  • Modifications: 0
  • Forum topics: 1
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 3
It uses biped
Thu, 07/02/2020 - 22:47

It uses biped

Active 3 years ago
Joined Jun 2016
Points:
3742

User statistics:

  • Modifications: 10
  • Forum topics: 39
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 5492
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

Active 4 years ago
Joined Jun 2020
Points:
588

User statistics:

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

Hi, thank you. Could you give a procedure example