Closed TigerWalts closed 5 months ago
This affects the twilight cloak and the mob charm items.
The problem is that both use event.setNewTarget(null);
in the LivingChangeTargetEvent
when they should be simply cancelling the event via event.setCanceled(true);
For those running into this problem and need a fix, you can disable the item in the player's Curios inventory as follows:
ForgeCaps
>curios:inventory
>Curios
Curios
inventory you'll find the items in the tag path StacksHandler
>Stacks
>Items
tag
tag and set the enabled
tag inside it to 0
If the item is in the main Inventory
tag and is passively enabled, you may have to resort to deleting it.
Having the Twilight Cloak near Hoglins may result in a crash. This has been observed in ATM9 0.0.45. It can also be reproduced with just Reliquary.
creative
and give yourself theTwilight Cloak
Hoglin spawn egg
and use it to spawn a hoglinsurvival
I checked the hoglin's save data between a crashing state and a normal state and their 'brain` tags are the same, containing an empty memories collection.
Because it didn't crash each time the invisibility effect was applied there may be a race involved.
The
MobHelper.resetTarget()
call may need to be run as a task at another point in the tick cycle, even though I can't see why it could cause this crash as it doesn't appear to remove any memories and sets them to Empty.https://github.com/P3pp3rF1y/Reliquary/blob/32deb62f8982941faa6f0837391e42314a48bc45/src/main/java/reliquary/util/MobHelper.java#L19-L39