From c90a6bf5ab4d1d96ac510f7357c9618c2bf4bc77 Mon Sep 17 00:00:00 2001 From: "Us3ful\"-Dev" Date: Tue, 10 Mar 2026 04:05:56 +0100 Subject: Fixed Enderman, monster aggro in creative (#1051) Fixed endermans by making a invulnerable check --- Minecraft.World/EnderMan.cpp | 7 ++++++- Minecraft.World/Monster.cpp | 9 ++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/Minecraft.World/EnderMan.cpp b/Minecraft.World/EnderMan.cpp index e1231818..da469a3a 100644 --- a/Minecraft.World/EnderMan.cpp +++ b/Minecraft.World/EnderMan.cpp @@ -410,9 +410,14 @@ bool EnderMan::hurt(DamageSource *source, float damage) if ( dynamic_cast(source) != nullptr && source->getEntity()->instanceof(eTYPE_PLAYER)) { - aggroedByPlayer = true; + if (!dynamic_pointer_cast(source->getEntity())->abilities.invulnerable) + { + aggroedByPlayer = true; + } + else setCreepy(false); } + if (dynamic_cast(source) != nullptr) { aggroedByPlayer = false; diff --git a/Minecraft.World/Monster.cpp b/Minecraft.World/Monster.cpp index 2de45315..ad19a36d 100644 --- a/Minecraft.World/Monster.cpp +++ b/Minecraft.World/Monster.cpp @@ -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(sourceEntity)->abilities.invulnerable) + { + attackTarget = sourceEntity; + } + } + else attackTarget = sourceEntity; } return true; } -- cgit v1.2.3