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

net.minestom.server.entity.damage.EntityDamage Maven / Gradle / Ivy

There is a newer version: 7320437640
Show newest version
package net.minestom.server.entity.damage;

import net.minestom.server.entity.Entity;
import org.jetbrains.annotations.NotNull;

/**
 * Represents damage inflicted by an {@link Entity}.
 */
public class EntityDamage extends Damage {

    public EntityDamage(@NotNull Entity source, float amount) {
        super(DamageType.MOB_ATTACK, source, source, null, amount);
    }

    /**
     * Gets the source of the damage.
     *
     * @return the source
     */
    @Override
    public @NotNull Entity getSource() {
        return super.getSource();
    }

    @Override
    public @NotNull Entity getAttacker() {
        return getSource();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy