(SOLVED) The condition check does not work when an entity is attacked

Started by ImSeyo on

Topic category: Help with Minecraft modding (Java Edition)

Joined Oct 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
(SOLVED) The condition check does not work when an entity is attacked
Sat, 01/06/2024 - 06:52 (edited)

So. My idea is for my entity to attack the player with the check "RETURN if a certain global variable = true AND the player's command = red":

procedure

After that, I inserted this trigger into the AI entity to check the attack on the player:

ai and goals

I launch my world and as a result, after the entity finds the player, the game immediately crashes with an error.

I had to try a lot of options to fix this error and that's what I managed to find out. Some of them work and some don't (the game crashes):

procedure

In addition, I even had to resort to NBT tags, but still without success.

I have not found any information about this anywhere and I ask you to help.

Edited by ImSeyo on Sat, 01/06/2024 - 06:52
Joined Oct 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
So, good. I had to resort to…
Thu, 01/04/2024 - 15:29

So, good. I had to resort to using custom potions. But I will not close this forum, because suddenly someone will face the same problem and in no case should he resort to the potion option. I'm waiting for an answer anyway.

I tried to try sending a…
Fri, 01/05/2024 - 18:02

I tried to try sending a crash log using comments, but you can't insert too much text here. 

Because it is not allowed. Please read General Publishing Guidelines.

java.lang.NullPointerException: Cannot invoke "net.minecraft.world.entity.Entity.getCapability(net.minecraftforge.common.capabilities.Capability, net.minecraft.core.Direction)"

It seems you are using entity procedure block that can return null value. Check out https://github.com/MCreator/MCreator/issues/4461

Joined Oct 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Okay, thanks, I kind of…
Sat, 01/06/2024 - 06:52

Okay, thanks, I kind of figured it out