Fixed Enderman, monster aggro in creative (#1051)

Fixed endermans by making a invulnerable check
This commit is contained in:
Us3ful"-Dev
2026-03-10 04:05:56 +01:00
committed by GitHub
parent 5f777a7f45
commit c90a6bf5ab
2 changed files with 14 additions and 2 deletions

View File

@@ -60,7 +60,14 @@ bool Monster::hurt(DamageSource *source, float dmg)
if (sourceEntity != shared_from_this())
{
attackTarget = sourceEntity;
if (sourceEntity->instanceof(eTYPE_PLAYER))
{
if (!dynamic_pointer_cast<Player>(sourceEntity)->abilities.invulnerable)
{
attackTarget = sourceEntity;
}
}
else attackTarget = sourceEntity;
}
return true;
}