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/Monster.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'Minecraft.World/Monster.cpp') 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