Started by
D1athForYou
on
Topic category: Help with Minecraft modding (Java Edition)
https://pastebin.com/ZrbSbxAk (error log)
when i sue the attack "Full Counter" enchantment on any mob i wanted it to damage the mob the amount it hit me and heal me back instantly(basically spike enchantment but on a sword) but when the npc hits me the game crashes.
The problem is that 'get entity event/target entity is targeting' returns a null entity if the target isn't attacking anything. In this case, the event/target entity is the one being attacked; so if you attack an entity that isn't targeting you, it will return a null entity and crash the game. (I'm not totally sure that's how you want this to work- you might need to use the source entity instead.) If you add an if bracket that checks that the targeted entity exists, that should fix the problem.