Error: Game crashes if I use "Is <Find Nearest Entity of Type <X>> <Y>"

Started by LunarArmageddon99 on

Topic category: Help with MCreator software

Joined Aug 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Error: Game crashes if I use "Is <Find Nearest Entity of Type <X>> <Y>"

If I try to make a procedure like in this image, my game crashes when trying to run it.  Not sure if I'm doing something wrong here, but its going to absolutely suck regardless if I have to get rid of this code, because this entity won't be the same without doing this.  I was just going to paste the crash report into this post, since it isn't that terribly long, but apparently it contains "words that are not allowed on this website" ("Forbidden. Contains contacts. Message seems to be spam. Anti-Spam by CleanTalk.").

Joined Apr 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Try checking if the entity…
Tue, 09/09/2025 - 00:00

Try checking if the entity exists in that area before finding it, that usually fixes the crash 

Joined Aug 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Try checking if the entity…
Tue, 09/09/2025 - 01:17

Try checking if the entity exists in that area before finding it, that usually fixes the crash 

That worked, but I'm so curious as to why.  Shouldn't it just not do anything on it's own if it finds no enemies of that type in the area?

Joined Apr 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
When you check if the…
Tue, 09/09/2025 - 08:20

When you check if the nearest chicken is a child while there are no chickens nearby the game checks if "nothing" (null) is a child, and that's something you can't do