All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.bukkit.event.entity.EntityDamageByEntityEvent Maven / Gradle / Ivy

package org.bukkit.event.entity;

import com.google.common.base.Function;
import org.bukkit.entity.Entity;

import java.util.Map;

/**
 * Called when an entity is damaged by an entity
 */
public class EntityDamageByEntityEvent extends EntityDamageEvent {
  private final Entity damager;

  @Deprecated
  public EntityDamageByEntityEvent(final Entity damager, final Entity damagee, final DamageCause cause, final int damage) {
    this(damager, damagee, cause, (double) damage);
  }

  @Deprecated
  public EntityDamageByEntityEvent(final Entity damager, final Entity damagee, final DamageCause cause, final double damage) {
    super(damagee, cause, damage);
    this.damager = damager;
  }

  public EntityDamageByEntityEvent(final Entity damager, final Entity damagee, final DamageCause cause, final Map modifiers, final Map> modifierFunctions) {
    super(damagee, cause, modifiers, modifierFunctions);
    this.damager = damager;
  }

  /**
   * Returns the entity that damaged the defender.
   *
   * @return Entity that damaged the defender.
   */
  public Entity getDamager() {
    return damager;
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy