How to make the Warden not hostile to my custom mob

Started by BryAstro on

Topic category: Help with Minecraft modding (Java Edition)

Joined Mar 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to make the Warden not hostile to my custom mob

Version 2024.4 (1.20.1 Forge)

Hello, I would like to make a mob that acts as an ally to the Warden? How can I make the Warden non-hostile towards my custom mob, and how can I make it so that the mob is hostile to every target except it's own kind and the Warden?

Help would be very appreciated.  

Joined Mar 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
maybe set the attack target…
Fri, 12/19/2025 - 11:51

maybe set the attack target of the warden to no entity sorry if im late

Joined Mar 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
wait BryAstro, copy this,…
Tue, 12/23/2025 - 09:17

wait BryAstro, copy this, the code:if (entity instanceof Warden _warden) {
   Optional<LivingEntity> suspects = _warden.getEntityAngryAt();

   suspects.stream().forEach(_entity -> {
           if (_entity.getType().is(TagKey.create(Registries.ENTITY_TYPE, ResourceLocation.parse("beneath_the_void:warden_ignore")))) {
           _warden.clearAnger(_entity);
       }
   });
}