Minecraft crashes after entity targets me to attack

Started by fleWaf on

Topic category: Help with Minecraft modding (Java Edition)

Joined Oct 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Minecraft crashes after entity targets me to attack

I'm making an entity called "Apex Hyperion" and when I spawn it the game crashes. I'm using a procedure to make a special attack and that seems to crash it. I removed the procedure and it worked fine. Apparently, it cannot get "getx" from the procedure.

Here´s crash log: https://pastebin.com/Ph1kTRVm

Procedure code (ApexHyperionPunch):  https://pastebin.com/WAaBWBSw

 

Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
It's kinda hard to tell…
Fri, 12/08/2023 - 12:41

It's kinda hard to tell without a picture of the procedure, but my guess is that you're somehow not giving it the correct entity to reference. Any entity function that has 'null' on it will return a null entity if its condition is not met, which can very easily crash the game. (Nearest entity, Entity targeted for attack, etc.) You generally want to first check that the nearest/targeted entity exists, (check if it's a subtype of 'living entity,') before doing anything with it. That may not fix the procedure, necessarily, but if this is the issue it should stop it from crashing.