mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-17 15:45:10 +00:00
Added setImmune() function to ScriptEntity.
This commit is contained in:
1 parent
27dce4a90a
commit
2ffa9bfcfa
3 files changed
+10
-2
No files matched your search
@@ -473,6 +473,10 @@ public class ScriptEntity<T extends Entity> implements IEntity {
|
||||
entity.hurtResistantTime = 0;
|
||||
}
|
||||
|
||||
public void setImmune(int ticks) {
|
||||
entity.hurtResistantTime = ticks;
|
||||
};
|
||||
|
||||
/**
|
||||
* @since 1.7.10c
|
||||
* @return Returns whether or not this entity is sneaking
|
||||
|
||||
@@ -38,11 +38,11 @@ public class ScriptLivingBase<T extends EntityLivingBase> extends ScriptEntity<T
|
||||
entity.attackEntityFrom(DamageSource.generic,damage);
|
||||
}
|
||||
|
||||
public void hurt(float damage, ScriptEntity source){
|
||||
public void hurt(float damage, ScriptEntity source) {
|
||||
entity.attackEntityFrom(new EntityDamageSource(source.getTypeName(),source.getMCEntity()),damage);
|
||||
}
|
||||
|
||||
public void hurt(float damage, ScriptDamageSource damageSource){
|
||||
public void hurt(float damage, ScriptDamageSource damageSource) {
|
||||
entity.attackEntityFrom(damageSource.getMCDamageSource(),damage);
|
||||
}
|
||||
|
||||
|
||||
@@ -282,6 +282,10 @@ public interface IEntity<T extends Entity> {
|
||||
*/
|
||||
public void knockback(int power, float direction);
|
||||
|
||||
public void knockback(int xpower, int ypower, int zpower, float direction);
|
||||
|
||||
public void setImmune(int ticks);
|
||||
|
||||
/**
|
||||
* @since 1.7.10c
|
||||
* @return Returns whether or not this entity is sneaking
|
||||
|
||||
Reference in new issue
Block a user