Modify Mob Health

Discussion in 'Plugin Development' started by Jakesully123456, May 23, 2015.

Thread Status:
Not open for further replies.
  1. Offline

    Jakesully123456

    Hello, how do I change the default value of a mob's health? For example, I want all creepers to have 80HP.
     
  2. Offline

    SirMonkeyFood

    Test for Creepers around Players, then if there's any within 10 blocks give them a resistance potion effect?
     
  3. Offline

    caderape

    @Jakesully123456
    get the event creatureSpawnEvent, get the entity and set the health
     
  4. Offline

    Signatured

    Listen for CreatureSpawnEvent, check if it's a creeper, set its max health to whatever you want (remember 10 hearts = 20D, your in your case 80 hearts would be 160D), then set their health to the max health with .setHealth(amount).
     
  5. Offline

    Zombie_Striker

    Eh hem..
    Code:
    Damageable dam = (Damageable) Entity#;
    dam.setMaxHealth(80);
    dam.setHealth(80);
     
Thread Status:
Not open for further replies.

Share This Page