mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-13 20:44:08 +00:00
49 lines
988 B
Java
49 lines
988 B
Java
package noppes.npcs.scripted.event;
|
|
|
|
import net.minecraft.entity.EntityLivingBase;
|
|
import noppes.npcs.controllers.ScriptController;
|
|
import noppes.npcs.scripted.entity.ScriptLivingBase;
|
|
|
|
public class ScriptEventAttack extends ScriptEvent{
|
|
|
|
private float damage;
|
|
private ScriptLivingBase target;
|
|
private boolean isRanged;
|
|
|
|
public ScriptEventAttack(float damage, EntityLivingBase target, boolean isRanged){
|
|
this.damage = damage;
|
|
this.isRanged = isRanged;
|
|
this.target = (ScriptLivingBase)ScriptController.Instance.getScriptForEntity(target);
|
|
}
|
|
|
|
/**
|
|
* @return The source of the damage
|
|
* @deprecated
|
|
*/
|
|
public ScriptLivingBase getTarget(){
|
|
return target;
|
|
}
|
|
|
|
|
|
/**
|
|
* @return Returns the damage value
|
|
*/
|
|
public float getDamage(){
|
|
return damage;
|
|
}
|
|
|
|
/**
|
|
* @param damage The new damage value
|
|
*/
|
|
public void setDamage(float damage){
|
|
this.damage = damage;
|
|
}
|
|
|
|
/**
|
|
* @return Returns the damage type
|
|
*/
|
|
public boolean isRange(){
|
|
return isRanged;
|
|
}
|
|
}
|