mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-12 02:37:27 +00:00
Fixed overloaded hurt(damage,entity) function not working when an entity is to be hurt by a player
This commit is contained in:
1 parent
06c730b166
commit
092b3ce0c1
3 files changed
+10
-4
No files matched your search
@@ -41,7 +41,10 @@ public class ScriptLivingBase<T extends EntityLivingBase> extends ScriptEntity<T
|
||||
}
|
||||
|
||||
public void hurt(float damage, ScriptEntity source) {
|
||||
entity.attackEntityFrom(new EntityDamageSource(source.getTypeName(),source.getMCEntity()),damage);
|
||||
if(source.getType() == 1)//if player
|
||||
entity.attackEntityFrom(new EntityDamageSource("player",source.getMCEntity()),damage);
|
||||
else
|
||||
entity.attackEntityFrom(new EntityDamageSource(source.getTypeName(),source.getMCEntity()),damage);
|
||||
}
|
||||
|
||||
public void hurt(float damage, ScriptDamageSource damageSource) {
|
||||
|
||||
Reference in new issue
Block a user