(SOLVED) How do i stop my game crashing when teleporting the nearest entity to it?

Started by spacecowboy234 on

Topic category: Help with MCreator software

Joined May 2026
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
(SOLVED) How do i stop my game crashing when teleporting the nearest entity to it?
Mon, 05/04/2026 - 22:56 (edited)

So for my custom entity it has two hitboxes, one for its helmet and its body. And for the helmet hitbox I made it another entity that constantly teleports to the main entity so the hitbox stays still and consistent. And it works fine but when I spawn the custom entity on the same block the game crashes, I get why this happens because its trying to find the nearest entity but is there any alternative way to get the same function without crashing the game when they are close to eachother?

 

 

Edited by spacecowboy234 on Mon, 05/04/2026 - 22:56
Joined May 2026
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I found an alternative…
Mon, 05/04/2026 - 22:55

I found an alternative method for the hitboxes without the game crashing thank you for your help though