Custom Entity Attack Reach is too big [FIXED]

Started by guardtown4 on

Topic category: Troubleshooting, bugs, and solutions

Last seen on 23:06, 26. Jul 2022
Joined Jul 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Custom Entity Attack Reach is too big [FIXED]
Thu, 06/30/2022 - 17:22 (edited)

This has been posted before but did not receive a good solution.

I made a custom entity with the "Mob aggressive towards player" base. The only problem is the player gets hit by it when they are standing up to 2 blocks away. Changing the bounding box did not seem to help. 

How do I make it so the player only gets hit when the mob collides with them? (Or just the attack reach is lower)

Edited by guardtown4 on Thu, 06/30/2022 - 17:22
Last seen on 23:06, 26. Jul 2022
Joined Jul 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Closing this thread. The…
Thu, 06/30/2022 - 17:21

Closing this thread.

The solutions I found included using custom code, which I tried at first but also made it so my entities stopped targeting the player. I tried again, just completely removing the number value from the custom code (4.0 + entity.width*entity.width), and it worked perfectly.