Easy NPC

Easy NPC

2M Downloads

[Bug] Game Crashes on Spawn Humanoid NPC with Botania (1.20.1)

SolarisGC opened this issue ยท 4 comments

commented

image

Crashing with this error message

commented

Thanks for the crash log, but this crash is cause by Botania see:

java.lang.NullPointerException: Cannot invoke "net.minecraft.world.item.trading.MerchantOffers.iterator()" because the return value of "net.minecraft.world.item.trading.Merchant.m_6616_()" is null
	at vazkii.botania.common.item.equipment.bauble.SpectatorItem.scanForStack(SpectatorItem.java:144) ~[Botania-1.20.1-443-FORGE.jar%23235!/:1.20.1-443-FORGE] {re:classloading}
	at vazkii.botania.common.item.equipment.bauble.SpectatorItem.tickServer(SpectatorItem.java:114) ~[Botania-1.20.1-443-FORGE.jar%23235!/:1.20.1-443-FORGE] {re:classloading}
	at vazkii.botania.common.item.equipment.bauble.SpectatorItem.onWornTick(SpectatorItem.java:67) ~[Botania-1.20.1-443-FORGE.jar%23235!/:1.20.1-443-FORGE] {re:classloading}
	at vazkii.botania.forge.integration.curios.CurioIntegration$Wrapper.curioTick(CurioIntegration.java:124) ~[Botania-1.20.1-443-FORGE.jar%23235!/:1.20.1-443-FORGE] {re:classloading}
	at top.theillusivec4.curios.common.event.CuriosEventHandler.lambda$tick$30(CuriosEventHandler.java:566) ~[curios-forge-5.7.0+1.20.1.jar%23243!/:5.7.0+1.20.1] {re:classloading}
	at net.minecraftforge.common.util.LazyOptional.ifPresent(LazyOptional.java:137) ~[forge-1.20.1-47.2.20-universal.jar%23305!/:?] {re:mixin,re:classloading}
	at top.theillusivec4.curios.common.event.CuriosEventHandler.lambda$tick$35(CuriosEventHandler.java:566) ~[curios-forge-5.7.0+1.20.1.jar%23243!/:5.7.0+1.20.1] {re:classloading}
	at net.minecraftforge.common.util.LazyOptional.ifPresent(LazyOptional.java:137) ~[forge-1.20.1-47.2.20-universal.jar%23305!/:?] {re:mixin,re:classloading}
	at top.theillusivec4.curios.common.event.CuriosEventHandler.tick(CuriosEventHandler.java:545) ~[curios-forge-5.7.0+1.20.1.jar%23243!/:5.7.0+1.20.1] {re:classloading}
	at top.theillusivec4.curios.common.event.__CuriosEventHandler_tick_LivingTickEvent.invoke(.dynamic) ~[curios-forge-5.7.0+1.20.1.jar%23243!/:5.7.0+1.20.1] {re:classloading,pl:eventbus:B}
	at net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:73) ~[eventbus-6.0.5.jar%2387!/:?] {}
	at net.minecraftforge.eventbus.EventBus.post(EventBus.java:315) ~[eventbus-6.0.5.jar%2387!/:?] {}
	at net.minecraftforge.eventbus.EventBus.post(EventBus.java:296) ~[eventbus-6.0.5.jar%2387!/:?] {}
	at net.minecraftforge.common.ForgeHooks.onLivingTick(ForgeHooks.java:264) ~[forge-1.20.1-47.2.20-universal.jar%23305!/:?] 

They are scanning for trading offers and not checking if there are any trading offers at all:
https://github.com/VazkiiMods/Botania/blob/e119ab641af68e24f6845c11f0251260c03fa64c/Xplat/src/main/java/vazkii/botania/common/item/equipment/bauble/SpectatorItem.java#L143C12-L151C6

This needs to be fixed by Botania by adding a null check.

If you reference to this issue, they should be able to understand and fix the issue on their side.

commented

Thanks for the report. Please share the crash log and the exact version you are using like 4.x beta or 3.10 release ?

commented

Thanks for the report. Please share the crash log and the exact version you are using like 4.x beta or 3.10 release ?
crash-2024-03-28_14.48.31-server.txt

Hey there, so i tested it in both versions and both originated the same issue, follow above the complete crash log =)

commented

Any news about the error?