Mob Attack Range Value

Started by OMGitsMiniMe on Wed, 05/18/2022 - 23:11

Topic category: Feature requests and ideas for MCreator

Last seen on 01:29, 11. Jun 2022
Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Mob Attack Range Value
Wed, 05/18/2022 - 23:11

I am making a mod with very small mobs and I would like to be able to change the attack range of them because they can attack each other from very far away (1-2 blocks). and id like them to have to get right up on each other to attack each other. thank you!

Last seen on 14:11, 23. Jun 2022
Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
open your Entity code find…
Thu, 05/26/2022 - 01:47

open your Entity code

find registerGoals


		@Override
		protected void registerGoals() {
			super.registerGoals();
......
			this.goalSelector.addGoal(1, new MeleeAttackGoal(this, 1.2, false) {
				@Override
				protected double getAttackReachSqr(LivingEntity entity) {
					return (double) (4 + entity.getWidth() * entity.getWidth());
				}
			});
......
		}

return (double) (4 + entity.getWidth() * entity.getWidth());

Try reducing the value of 4, it should reduce the attack range

For example my ZombieArm entity is using 0.5

Last seen on 01:29, 11. Jun 2022
Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
thank you so much. they…
Sat, 05/28/2022 - 03:24

thank you so much. they should really add this to the properties or something. it really shouldn't be that hard to add should it