Jump to content

KopoL

Members
  • Posts

    5
  • Joined

  • Last visited

KopoL's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. Ok, thank you anyway. I'll try with coremodding.
  2. Okay, thank you. But do you think of any other way to prevent them from attacking the player without making him invulnerable - without using abilities? Because using core modding is my final solution, If I had any other option I'd prefer to use it.
  3. Everything is still the same, only mappings changed.
  4. Forge 1.17.1 Hello. I want to do something like scare mobs potion effect. It basically would make mobs ignore the player, just like on gamemode creative. I discovered that when I give player disableDamage ability (player.abilities.disableDamage), mobs start to ignore the player. But I don't want to make player invulnerable (I'll use tags). Then I found this method in MobEntity class: public boolean canAttack(LivingEntity target) { return target.getType() == EntityType.PLAYER && ((PlayerEntity)target).abilities.disableDamage ? false : super.canAttack(target); } I just need to somehow override/change/...? it to something like return target.getType() == EntityType.PLAYER && ((PlayerEntity)target).getTags().contains("scare_mobs") ? false && ((PlayerEntity)target).abilities.disableDamage ? false : super.canAttack(target);) but I don't really know how. What is the best way to do this, without breaking the game?
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.