Package org.spout.vanilla.event.entity

Examples of org.spout.vanilla.event.entity.EntityHealthChangeEvent


   */
  public void setHealth(float health, HealthChangeCause cause) {
    if (!VanillaConfiguration.PLAYER_SURVIVAL_ENABLE_HEALTH.getBoolean()) {
      return;
    }
    EntityHealthChangeEvent event = new EntityHealthChangeEvent(getOwner(), cause, health - getHealth());
    getEngine().getEventManager().callEvent(event);
    if (!event.isCancelled()) {
      if (getHealth() + event.getChange() > getMaxHealth()) {
        getData().put(VanillaData.HEALTH, getMaxHealth());
      } else {
        getData().put(VanillaData.HEALTH, getHealth() + event.getChange());
      }
    }

    // Special cases
    Entity owner = getOwner();
View Full Code Here

TOP

Related Classes of org.spout.vanilla.event.entity.EntityHealthChangeEvent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.