Started by
BryAstro
on
Topic category: Help with Minecraft modding (Java Edition)
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.
maybe set the attack target of the warden to no entity sorry if im late
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);
}
});
}
Where would I put the code?
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"
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:
Hey ! (Alt account) the warden roaring is basically telling it’s gonna be mod not it’s mad now, hope u understand,
Mad*
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.
same man