Hostile mobs ignore the disguise and target the player
Opened this issue ยท 11 comments
Problem description
Even though the player is disguised as another mob, hostile mobs still target the player.
Please offer a config option that allows hostile mobs to honor the disguise.
Examples
Example 1
Situation: Player (Disguised as Zombie) vs Slime/Creeper
Expected result: Slime/Creeper will not target (attack) the player.
Example 2
Situation: Player (Disguised as Spider) vs Wither
Expected result: Wither will target (attack) the player, since Spider is not an undead mob. According to the Official Minecraft Wiki, Wither is hostile toward all mobs except undead mobs, ghasts, and players in creative or spectator mode.
Fixed portions of this in 1.1.0-beta (GH, CF).
Hostile mobs will now ignore Players morphed as hostiles if hostilesIgnoreHostileIdentityPlayer
is true (defaults to true) but will attack in revenge when hit, even if the player is still morphed. hostilesForgetNewHostileIdentityPlayer
is another option related to this; if true, hostiles will forget their hostility if a player morphs into a hostile mid-fight. This defaults to false.
The Wither will now ignore players disguised as undead entities but will revenge attack in a similar fashion to the above case when hit.
I'm skipping Piglins & Hoglin interactions for now because they (at least, one of them) use a special brain-based AI system, and I have no idea how it works. I'll fix them in a future update.
Wolves should attach players disguised as sheep, foxes, or skeletons; this is defined in the wolf_prey
tag, and only takes effect if wolvesAttackIdentityPrey
is true (defaults to true). If ownedWolvesAttackIdentityPrey
is true (defaults to false), Wolves owned by Players will attack other Players if the above criteria is met.
Same situation for Foxes, with the tag being fox_prey
and the config option being foxesAttackIdentityPrey
. They seem to be a little bit finicky right now because they target the player while running at the same time. Will have to fix that in the future.
Villagers will fast-run from players disguised as bad guys (more specifically, anything in VillagerHostilesSensor#SQUARED_DISTANCES_FOR_DANGER
map, aka. Drowned, Evokers, Zombies, and normal stuff) if villagersRunFromIdentities
is true (defaults to true).
Will get around to Hoglins and Piglins in the next few days. Thanks for all the great ideas and feedback!
Additional example situations (Not all of them are only related to combat):
Situation: Player (disguised as Piglin) vs Piglin
Expected result: Even when not wearing gold armor, other Piglins do not attack you. Wither Skeletons will still attack you.
Situation: Player (disguised as Hoglin) vs Piglin
Expected result: Occasionally, Piglins will attack you as part of their regular Hoglin hunting routine.
Situation: Player (disguised as any undead) vs Wither
Expected result: Wither will not attack the player, since Withers do not attack undead mobs.
Situation: Player (disguised as Sheep, Fox, or Skeleton) vs Wolf
Expected result: Wolf will attack the player regardless, since Wolf hunt for both Sheep and Skeleton.
Situation: Player (disguised as e.g. Chicken or Fish) vs Fox
Expected result: Fox will attack the player regardless, since Fox hunt for those mobs.
Situation: Player (disguised as any Illager) vs any other Illager
Expected result: Other Illagers will not attack the player.
Situation: Player (disguised as any Zombie) vs Villager
Expected result: Nearby Villagers will run away from you and not trade.
Also, Enderman and Strider Identities do not take damage from rain/water, even though the corresponding actual mobs do.
Thanks for the update. Here are some bugs in the latest version:
- When I am morphed as a Blaze, Slime still attacks me. (But the feature works for Creeper and Pillager.)
- When I am morphed as a Blaze and underwater, I am not taking damage like a real Blaze. (But I am immune to lava.)
- When I am morphed as a Snow Golem in the Nether, I am not taking damage like a real Snow Golem.
By the way, should there be a config option that makes hostile mobs ignore Players morphed as passive mobs like Bat?
(Currently, hostile mobs still attack Players morphed as Bat.)
I haven't fixed slimes yet, but that's because they aren't classified as hostile entities
The issue affects Magma Cubes as well.
2 and 3 have been implemented in 1.2.0-beta, as well as the Enderman/Strider rain/water damage. I haven't fixed slimes yet, but that's because they aren't classified as hostile entities (I would have to manually check for them). Regarding passive mobs, I am still thinking about it (I will implement it, just not sure if it'll be turned on or off by default).
Update:
- Ghasts and Phantoms seem to ignore my Blaze disguise.
- Creepers and Phantoms seem to ignore my Cat disguise and do not run away.
Since Vindicators with the Johnny
flag set attack pretty much any other entity (except other illagers), I think they should ignore the hostilesIgnoreHostileIdentityPlayer
and hostilesForgetNewHostileIdentityPlayer
config settings (as well as hostilesIgnorePassiveIdentityPlayer
if that gets added) and attack you anyway regardless of your currently equipped Identity (unless it's an Illager, in which case other Illagers won't automatically attack).
In 1.3.0, Creepers run from Ocelots, and Ghast/Phantom/Slime/MagmaCube targeting has been fixed.