Mob Attack Range Value

Started by OMGitsMiniMe on

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:
  • MCreator plugins:
  • Comments:
Mob Attack Range Value

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 01:06, 14. Mar 2024
Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • 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:
  • 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