1.17.x how to set an attribute to a mob

Discussion in 'Spigot Plugin Development' started by mason-walker, Jun 29, 2021.

  1. How can i set an attribute to a mob, because I want to set the max health of a mob, and stuff like speed and damage.
  2. Maybe you can post how to do it, it might be useful to others
  3. I accidently put solved
  4. 2 things to add:
    1) Always make sure that the attribute you got isn't null
    2) If you increase the maximum health of an entity don't forget to change its current health as well with ".setHealth()" (it only updates it if you decrease it below its current value)