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);
       }
   });
}

Joined Mar 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Where would I put the code?
Sat, 12/27/2025 - 08:51

Where would I put the code?

Joined Mar 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
https://ibb.co/nsCxQH2Z also…
Sat, 01/24/2026 - 09:18

https://ibb.co/nsCxQH2Z also for the "beneath_the_void:warden_ignore" just make a new tag and it should look like dis, "urmodname:warden_ignore"

Joined Mar 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
The code works! It doesn't…
Sun, 01/25/2026 - 06:14

The code works! It doesn't attack my custom mob anymore! It still roars at it but at least the code works. Thank you very much!

Just two questions for extra points:

  1. Is there a way to make it not roar at my custom entity?
  2. Could this code be used to make a modified version of the code that makes it so that it can make any mob (or all mobs in a certain "creature type" or "entity tag") ignores mobs that are a certain creature type and/or a certain entity tag? (e.g. I also want to make multiple mobs that are tagged as "demons" and they should attack a mob unless if said mob was an undead or also tagged as a demon.)
Joined Jan 2026
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Hey ! (Alt account) the…
Mon, 01/26/2026 - 07:29

Hey ! (Alt account) the warden roaring is basically telling it’s gonna be mod not it’s mad now, hope u understand, 

Joined Nov 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I know this is a bit late…
Sun, 06/21/2026 - 00:44

I know this is a bit late but is there any chance you can help me with your code? I used it in my mod and it worked perfectly until I updated it to 26.2, and now it won't work properly and I'm having issues finding workarounds.

 

Joined Mar 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
same man
Thu, 07/23/2026 - 07:00

same man