Fixed overloaded hurt(damage,entity) function not working when an entity is to be hurt by a player

This commit is contained in:
luisc committed 2022-01-22 22:50:01 -06:00
1 parent 06c730b166
commit 092b3ce0c1
3 files changed
+10 -4

No files matched your search

@@ -233,7 +233,10 @@ public class WrapperNpcAPI extends NpcAPI {
}
public IDamageSource getIDamageSource(IEntity entity) {
return new ScriptDamageSource(new EntityDamageSource(entity.getTypeName(),entity.getMCEntity()));
if(entity.getType() == 1)//if player
return new ScriptDamageSource(new EntityDamageSource("player",entity.getMCEntity()));
else
return new ScriptDamageSource(new EntityDamageSource(entity.getTypeName(),entity.getMCEntity()));
}
public void executeCommand(IWorld world, String command) {