Calls ITravelersBackpack#synchroniseToOthers when the player dies, throwing a NullPointerException
iMoonDay opened this issue ยท 4 comments
NeoForge-1.21-10.0.5
Hello, I'm a developer of the Soulbound mod.
I'm testing my mod with your mod (NeoForge-1.21-10.0.5) and the game throws an exception when calling the following code in PlayerEvent.Clone
event, but the game does not crash:
I'm not sure if it's appropriate to call this method when copying a player. Is this considered a bug?
iTravelersBackpack.synchronise();
iTravelersBackpack.synchroniseToOthers(newPlayer);
[20:47:26] [Render thread/ERROR] [minecraft/BlockableEventLoop]: Error executing task on Client
java.util.concurrent.CompletionException: java.lang.NullPointerException: Cannot invoke "net.minecraft.world.entity.player.Player.getData(net.neoforged.neoforge.attachment.AttachmentType)" because "player" is null
at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:315) ~[?:?] {}
at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:320) ~[?:?] {}
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run$$$capture(CompletableFuture.java:1770) ~[?:?] {}
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java) ~[?:?] {}
at TRANSFORMER/[email protected]/net.minecraft.util.thread.BlockableEventLoop.doRunTask(BlockableEventLoop.java:151) ~[neoforge-21.0.167-minecraft-merged.jar%23183!/:?] {re:classloading,pl:accesstransformer:B}
at TRANSFORMER/[email protected]/net.minecraft.util.thread.ReentrantBlockableEventLoop.doRunTask(ReentrantBlockableEventLoop.java:24) ~[neoforge-21.0.167-minecraft-merged.jar%23183!/:?] {re:classloading}
at TRANSFORMER/[email protected]/net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:122) ~[neoforge-21.0.167-minecraft-merged.jar%23183!/:?] {re:classloading,pl:accesstransformer:B}
at TRANSFORMER/[email protected]/net.minecraft.util.thread.BlockableEventLoop.runAllTasks(BlockableEventLoop.java:111) ~[neoforge-21.0.167-minecraft-merged.jar%23183!/:?] {re:classloading,pl:accesstransformer:B}
at TRANSFORMER/[email protected]/net.minecraft.client.Minecraft.runTick(Minecraft.java:1161) ~[neoforge-21.0.167-minecraft-merged.jar%23183!/:?] {re:classloading,pl:runtimedistcleaner:A}
at TRANSFORMER/[email protected]/net.minecraft.client.Minecraft.run(Minecraft.java:813) ~[neoforge-21.0.167-minecraft-merged.jar%23183!/:?] {re:classloading,pl:runtimedistcleaner:A}
at TRANSFORMER/[email protected]/net.minecraft.client.main.Main.main(Main.java:230) ~[neoforge-21.0.167-minecraft-merged.jar%23183!/:?] {re:classloading,pl:runtimedistcleaner:A}
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) ~[?:?] {}
at java.base/java.lang.reflect.Method.invoke(Method.java:580) ~[?:?] {}
at MC-BOOTSTRAP/[email protected]/net.neoforged.fml.loading.targets.CommonLaunchHandler.runTarget(CommonLaunchHandler.java:136) ~[loader-4.0.23.jar%23139!/:4.0] {}
at MC-BOOTSTRAP/[email protected]/net.neoforged.fml.loading.targets.CommonLaunchHandler.clientService(CommonLaunchHandler.java:124) ~[loader-4.0.23.jar%23139!/:4.0] {}
at MC-BOOTSTRAP/[email protected]/net.neoforged.fml.loading.targets.NeoForgeClientUserdevLaunchHandler.runService(NeoForgeClientUserdevLaunchHandler.java:23) ~[loader-4.0.23.jar%23139!/:4.0] {}
at MC-BOOTSTRAP/[email protected]/net.neoforged.fml.loading.targets.CommonLaunchHandler.lambda$launchService$4(CommonLaunchHandler.java:118) ~[loader-4.0.23.jar%23139!/:4.0] {}
at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:30) [modlauncher-11.0.4.jar%23121!/:?] {}
at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:53) [modlauncher-11.0.4.jar%23121!/:?] {}
at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:71) [modlauncher-11.0.4.jar%23121!/:?] {}
at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.Launcher.run(Launcher.java:103) [modlauncher-11.0.4.jar%23121!/:?] {}
at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.Launcher.main(Launcher.java:74) [modlauncher-11.0.4.jar%23121!/:?] {}
at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:26) [modlauncher-11.0.4.jar%23121!/:?] {}
at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:23) [modlauncher-11.0.4.jar%23121!/:?] {}
at [email protected]/cpw.mods.bootstraplauncher.BootstrapLauncher.run(BootstrapLauncher.java:210) [bootstraplauncher-2.0.2.jar:?] {}
at [email protected]/cpw.mods.bootstraplauncher.BootstrapLauncher.main(BootstrapLauncher.java:69) [bootstraplauncher-2.0.2.jar:?] {}
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) ~[?:?] {}
at java.base/java.lang.reflect.Method.invoke(Method.java:580) ~[?:?] {}
at [email protected]/net.neoforged.devlaunch.Main.main(Main.java:55) [DevLaunch-1.0.1.jar:?] {}
Caused by: java.lang.NullPointerException: Cannot invoke "net.minecraft.world.entity.player.Player.getData(net.neoforged.neoforge.attachment.AttachmentType)" because "player" is null
at TRANSFORMER/[email protected]/com.tiviacz.travelersbackpack.capability.AttachmentUtils.getAttachment(AttachmentUtils.java:21) ~[travelersbackpack-e2aP2Euz.jar%23187!/:?] {re:classloading}
at TRANSFORMER/[email protected]/com.tiviacz.travelersbackpack.network.ClientboundSyncAttachmentPacket.lambda$handle$2(ClientboundSyncAttachmentPacket.java:38) ~[travelersbackpack-e2aP2Euz.jar%23187!/:?] {re:classloading}
at TRANSFORMER/[email protected]/net.neoforged.neoforge.network.handling.ClientPayloadContext.enqueueWork(ClientPayloadContext.java:31) ~[neoforge-21.0.167-minecraft-merged.jar%23184!/:?] {re:classloading}
at TRANSFORMER/[email protected]/com.tiviacz.travelersbackpack.network.ClientboundSyncAttachmentPacket.handle(ClientboundSyncAttachmentPacket.java:34) ~[travelersbackpack-e2aP2Euz.jar%23187!/:?] {re:classloading}
at TRANSFORMER/[email protected]/net.neoforged.neoforge.network.handling.MainThreadPayloadHandler.lambda$handle$0(MainThreadPayloadHandler.java:16) ~[neoforge-21.0.167-minecraft-merged.jar%23184!/:?] {re:classloading}
at TRANSFORMER/[email protected]/net.minecraft.util.thread.BlockableEventLoop.lambda$submitAsync$0(BlockableEventLoop.java:60) ~[neoforge-21.0.167-minecraft-merged.jar%23183!/:?] {re:classloading,pl:accesstransformer:B}
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run$$$capture(CompletableFuture.java:1768) ~[?:?] {}
... 26 more
[20:47:30] [Render thread/ERROR] [ne.ne.ne.ne.re.NetworkRegistry/]: Failed to process a synchronized task of the payload: travelersbackpack:sync_attachment
java.util.concurrent.CompletionException: java.lang.NullPointerException: Cannot invoke "net.minecraft.world.entity.player.Player.getData(net.neoforged.neoforge.attachment.AttachmentType)" because "player" is null
at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:315) ~[?:?] {}
at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:320) ~[?:?] {}
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run$$$capture(CompletableFuture.java:1770) ~[?:?] {}
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java) ~[?:?] {}
at TRANSFORMER/[email protected]/net.minecraft.util.thread.BlockableEventLoop.doRunTask(BlockableEventLoop.java:151) ~[neoforge-21.0.167-minecraft-merged.jar%23183!/:?] {re:classloading,pl:accesstransformer:B}
at TRANSFORMER/[email protected]/net.minecraft.util.thread.ReentrantBlockableEventLoop.doRunTask(ReentrantBlockableEventLoop.java:24) ~[neoforge-21.0.167-minecraft-merged.jar%23183!/:?] {re:classloading}
at TRANSFORMER/[email protected]/net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:122) ~[neoforge-21.0.167-minecraft-merged.jar%23183!/:?] {re:classloading,pl:accesstransformer:B}
at TRANSFORMER/[email protected]/net.minecraft.util.thread.BlockableEventLoop.runAllTasks(BlockableEventLoop.java:111) ~[neoforge-21.0.167-minecraft-merged.jar%23183!/:?] {re:classloading,pl:accesstransformer:B}
at TRANSFORMER/[email protected]/net.minecraft.client.Minecraft.runTick(Minecraft.java:1161) ~[neoforge-21.0.167-minecraft-merged.jar%23183!/:?] {re:classloading,pl:runtimedistcleaner:A}
at TRANSFORMER/[email protected]/net.minecraft.client.Minecraft.run(Minecraft.java:813) ~[neoforge-21.0.167-minecraft-merged.jar%23183!/:?] {re:classloading,pl:runtimedistcleaner:A}
at TRANSFORMER/[email protected]/net.minecraft.client.main.Main.main(Main.java:230) ~[neoforge-21.0.167-minecraft-merged.jar%23183!/:?] {re:classloading,pl:runtimedistcleaner:A}
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) ~[?:?] {}
at java.base/java.lang.reflect.Method.invoke(Method.java:580) ~[?:?] {}
at MC-BOOTSTRAP/[email protected]/net.neoforged.fml.loading.targets.CommonLaunchHandler.runTarget(CommonLaunchHandler.java:136) ~[loader-4.0.23.jar%23139!/:4.0] {}
at MC-BOOTSTRAP/[email protected]/net.neoforged.fml.loading.targets.CommonLaunchHandler.clientService(CommonLaunchHandler.java:124) ~[loader-4.0.23.jar%23139!/:4.0] {}
at MC-BOOTSTRAP/[email protected]/net.neoforged.fml.loading.targets.NeoForgeClientUserdevLaunchHandler.runService(NeoForgeClientUserdevLaunchHandler.java:23) ~[loader-4.0.23.jar%23139!/:4.0] {}
at MC-BOOTSTRAP/[email protected]/net.neoforged.fml.loading.targets.CommonLaunchHandler.lambda$launchService$4(CommonLaunchHandler.java:118) ~[loader-4.0.23.jar%23139!/:4.0] {}
at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:30) [modlauncher-11.0.4.jar%23121!/:?] {}
at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:53) [modlauncher-11.0.4.jar%23121!/:?] {}
at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:71) [modlauncher-11.0.4.jar%23121!/:?] {}
at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.Launcher.run(Launcher.java:103) [modlauncher-11.0.4.jar%23121!/:?] {}
at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.Launcher.main(Launcher.java:74) [modlauncher-11.0.4.jar%23121!/:?] {}
at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:26) [modlauncher-11.0.4.jar%23121!/:?] {}
at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:23) [modlauncher-11.0.4.jar%23121!/:?] {}
at [email protected]/cpw.mods.bootstraplauncher.BootstrapLauncher.run(BootstrapLauncher.java:210) [bootstraplauncher-2.0.2.jar:?] {}
at [email protected]/cpw.mods.bootstraplauncher.BootstrapLauncher.main(BootstrapLauncher.java:69) [bootstraplauncher-2.0.2.jar:?] {}
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) ~[?:?] {}
at java.base/java.lang.reflect.Method.invoke(Method.java:580) ~[?:?] {}
at [email protected]/net.neoforged.devlaunch.Main.main(Main.java:55) [DevLaunch-1.0.1.jar:?] {}
Caused by: java.lang.NullPointerException: Cannot invoke "net.minecraft.world.entity.player.Player.getData(net.neoforged.neoforge.attachment.AttachmentType)" because "player" is null
at TRANSFORMER/[email protected]/com.tiviacz.travelersbackpack.capability.AttachmentUtils.getAttachment(AttachmentUtils.java:21) ~[travelersbackpack-e2aP2Euz.jar%23187!/:?] {re:classloading}
at TRANSFORMER/[email protected]/com.tiviacz.travelersbackpack.network.ClientboundSyncAttachmentPacket.lambda$handle$2(ClientboundSyncAttachmentPacket.java:38) ~[travelersbackpack-e2aP2Euz.jar%23187!/:?] {re:classloading}
at TRANSFORMER/[email protected]/net.neoforged.neoforge.network.handling.ClientPayloadContext.enqueueWork(ClientPayloadContext.java:31) ~[neoforge-21.0.167-minecraft-merged.jar%23184!/:?] {re:classloading}
at TRANSFORMER/[email protected]/com.tiviacz.travelersbackpack.network.ClientboundSyncAttachmentPacket.handle(ClientboundSyncAttachmentPacket.java:34) ~[travelersbackpack-e2aP2Euz.jar%23187!/:?] {re:classloading}
at TRANSFORMER/[email protected]/net.neoforged.neoforge.network.handling.MainThreadPayloadHandler.lambda$handle$0(MainThreadPayloadHandler.java:16) ~[neoforge-21.0.167-minecraft-merged.jar%23184!/:?] {re:classloading}
at TRANSFORMER/[email protected]/net.minecraft.util.thread.BlockableEventLoop.lambda$submitAsync$0(BlockableEventLoop.java:60) ~[neoforge-21.0.167-minecraft-merged.jar%23183!/:?] {re:classloading,pl:accesstransformer:B}
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run$$$capture(CompletableFuture.java:1768) ~[?:?] {}
... 26 more
I'm assuming it's probably because the newPlayer here hasn't been added to the world yet causing the playerEntity to be null.
final Player playerEntity = (Player) Minecraft.getInstance().player.level().getEntity(message.entityID);
ITravelersBackpack data = AttachmentUtils.getAttachment(playerEntity).orElseThrow(() -> new RuntimeException("No player attachment data found!"));
I think you shouldnt synchronise there, check NeoForgeEventHandler class and find PlayerEvent.Clone and check how Ive made cloning the attachment data. If that wont help I can help you further when I get back from vacation on monday
Hy
NeoForge-1.21-10.0.5
Hello, I'm a developer of the Soulbound mod.
I'm testing my mod with your mod (NeoForge-1.21-10.0.5) and the game throws an exception when calling the following code in
PlayerEvent.Clone
event, but the game does not crash:I'm not sure if it's appropriate to call this method when copying a player. Is this considered a bug?
iTravelersBackpack.synchronise(); iTravelersBackpack.synchroniseToOthers(newPlayer);
[20:47:26] [Render thread/ERROR] [minecraft/BlockableEventLoop]: Error executing task on Client java.util.concurrent.CompletionException: java.lang.NullPointerException: Cannot invoke "net.minecraft.world.entity.player.Player.getData(net.neoforged.neoforge.attachment.AttachmentType)" because "player" is null at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:315) ~[?:?] {} at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:320) ~[?:?] {} at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run$$$capture(CompletableFuture.java:1770) ~[?:?] {} at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java) ~[?:?] {} at TRANSFORMER/[email protected]/net.minecraft.util.thread.BlockableEventLoop.doRunTask(BlockableEventLoop.java:151) ~[neoforge-21.0.167-minecraft-merged.jar%23183!/:?] {re:classloading,pl:accesstransformer:B} at TRANSFORMER/[email protected]/net.minecraft.util.thread.ReentrantBlockableEventLoop.doRunTask(ReentrantBlockableEventLoop.java:24) ~[neoforge-21.0.167-minecraft-merged.jar%23183!/:?] {re:classloading} at TRANSFORMER/[email protected]/net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:122) ~[neoforge-21.0.167-minecraft-merged.jar%23183!/:?] {re:classloading,pl:accesstransformer:B} at TRANSFORMER/[email protected]/net.minecraft.util.thread.BlockableEventLoop.runAllTasks(BlockableEventLoop.java:111) ~[neoforge-21.0.167-minecraft-merged.jar%23183!/:?] {re:classloading,pl:accesstransformer:B} at TRANSFORMER/[email protected]/net.minecraft.client.Minecraft.runTick(Minecraft.java:1161) ~[neoforge-21.0.167-minecraft-merged.jar%23183!/:?] {re:classloading,pl:runtimedistcleaner:A} at TRANSFORMER/[email protected]/net.minecraft.client.Minecraft.run(Minecraft.java:813) ~[neoforge-21.0.167-minecraft-merged.jar%23183!/:?] {re:classloading,pl:runtimedistcleaner:A} at TRANSFORMER/[email protected]/net.minecraft.client.main.Main.main(Main.java:230) ~[neoforge-21.0.167-minecraft-merged.jar%23183!/:?] {re:classloading,pl:runtimedistcleaner:A} at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) ~[?:?] {} at java.base/java.lang.reflect.Method.invoke(Method.java:580) ~[?:?] {} at MC-BOOTSTRAP/[email protected]/net.neoforged.fml.loading.targets.CommonLaunchHandler.runTarget(CommonLaunchHandler.java:136) ~[loader-4.0.23.jar%23139!/:4.0] {} at MC-BOOTSTRAP/[email protected]/net.neoforged.fml.loading.targets.CommonLaunchHandler.clientService(CommonLaunchHandler.java:124) ~[loader-4.0.23.jar%23139!/:4.0] {} at MC-BOOTSTRAP/[email protected]/net.neoforged.fml.loading.targets.NeoForgeClientUserdevLaunchHandler.runService(NeoForgeClientUserdevLaunchHandler.java:23) ~[loader-4.0.23.jar%23139!/:4.0] {} at MC-BOOTSTRAP/[email protected]/net.neoforged.fml.loading.targets.CommonLaunchHandler.lambda$launchService$4(CommonLaunchHandler.java:118) ~[loader-4.0.23.jar%23139!/:4.0] {} at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:30) [modlauncher-11.0.4.jar%23121!/:?] {} at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:53) [modlauncher-11.0.4.jar%23121!/:?] {} at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:71) [modlauncher-11.0.4.jar%23121!/:?] {} at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.Launcher.run(Launcher.java:103) [modlauncher-11.0.4.jar%23121!/:?] {} at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.Launcher.main(Launcher.java:74) [modlauncher-11.0.4.jar%23121!/:?] {} at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:26) [modlauncher-11.0.4.jar%23121!/:?] {} at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:23) [modlauncher-11.0.4.jar%23121!/:?] {} at [email protected]/cpw.mods.bootstraplauncher.BootstrapLauncher.run(BootstrapLauncher.java:210) [bootstraplauncher-2.0.2.jar:?] {} at [email protected]/cpw.mods.bootstraplauncher.BootstrapLauncher.main(BootstrapLauncher.java:69) [bootstraplauncher-2.0.2.jar:?] {} at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) ~[?:?] {} at java.base/java.lang.reflect.Method.invoke(Method.java:580) ~[?:?] {} at [email protected]/net.neoforged.devlaunch.Main.main(Main.java:55) [DevLaunch-1.0.1.jar:?] {} Caused by: java.lang.NullPointerException: Cannot invoke "net.minecraft.world.entity.player.Player.getData(net.neoforged.neoforge.attachment.AttachmentType)" because "player" is null at TRANSFORMER/[email protected]/com.tiviacz.travelersbackpack.capability.AttachmentUtils.getAttachment(AttachmentUtils.java:21) ~[travelersbackpack-e2aP2Euz.jar%23187!/:?] {re:classloading} at TRANSFORMER/[email protected]/com.tiviacz.travelersbackpack.network.ClientboundSyncAttachmentPacket.lambda$handle$2(ClientboundSyncAttachmentPacket.java:38) ~[travelersbackpack-e2aP2Euz.jar%23187!/:?] {re:classloading} at TRANSFORMER/[email protected]/net.neoforged.neoforge.network.handling.ClientPayloadContext.enqueueWork(ClientPayloadContext.java:31) ~[neoforge-21.0.167-minecraft-merged.jar%23184!/:?] {re:classloading} at TRANSFORMER/[email protected]/com.tiviacz.travelersbackpack.network.ClientboundSyncAttachmentPacket.handle(ClientboundSyncAttachmentPacket.java:34) ~[travelersbackpack-e2aP2Euz.jar%23187!/:?] {re:classloading} at TRANSFORMER/[email protected]/net.neoforged.neoforge.network.handling.MainThreadPayloadHandler.lambda$handle$0(MainThreadPayloadHandler.java:16) ~[neoforge-21.0.167-minecraft-merged.jar%23184!/:?] {re:classloading} at TRANSFORMER/[email protected]/net.minecraft.util.thread.BlockableEventLoop.lambda$submitAsync$0(BlockableEventLoop.java:60) ~[neoforge-21.0.167-minecraft-merged.jar%23183!/:?] {re:classloading,pl:accesstransformer:B} at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run$$$capture(CompletableFuture.java:1768) ~[?:?] {} ... 26 more [20:47:30] [Render thread/ERROR] [ne.ne.ne.ne.re.NetworkRegistry/]: Failed to process a synchronized task of the payload: travelersbackpack:sync_attachment java.util.concurrent.CompletionException: java.lang.NullPointerException: Cannot invoke "net.minecraft.world.entity.player.Player.getData(net.neoforged.neoforge.attachment.AttachmentType)" because "player" is null at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:315) ~[?:?] {} at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:320) ~[?:?] {} at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run$$$capture(CompletableFuture.java:1770) ~[?:?] {} at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java) ~[?:?] {} at TRANSFORMER/[email protected]/net.minecraft.util.thread.BlockableEventLoop.doRunTask(BlockableEventLoop.java:151) ~[neoforge-21.0.167-minecraft-merged.jar%23183!/:?] {re:classloading,pl:accesstransformer:B} at TRANSFORMER/[email protected]/net.minecraft.util.thread.ReentrantBlockableEventLoop.doRunTask(ReentrantBlockableEventLoop.java:24) ~[neoforge-21.0.167-minecraft-merged.jar%23183!/:?] {re:classloading} at TRANSFORMER/[email protected]/net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:122) ~[neoforge-21.0.167-minecraft-merged.jar%23183!/:?] {re:classloading,pl:accesstransformer:B} at TRANSFORMER/[email protected]/net.minecraft.util.thread.BlockableEventLoop.runAllTasks(BlockableEventLoop.java:111) ~[neoforge-21.0.167-minecraft-merged.jar%23183!/:?] {re:classloading,pl:accesstransformer:B} at TRANSFORMER/[email protected]/net.minecraft.client.Minecraft.runTick(Minecraft.java:1161) ~[neoforge-21.0.167-minecraft-merged.jar%23183!/:?] {re:classloading,pl:runtimedistcleaner:A} at TRANSFORMER/[email protected]/net.minecraft.client.Minecraft.run(Minecraft.java:813) ~[neoforge-21.0.167-minecraft-merged.jar%23183!/:?] {re:classloading,pl:runtimedistcleaner:A} at TRANSFORMER/[email protected]/net.minecraft.client.main.Main.main(Main.java:230) ~[neoforge-21.0.167-minecraft-merged.jar%23183!/:?] {re:classloading,pl:runtimedistcleaner:A} at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) ~[?:?] {} at java.base/java.lang.reflect.Method.invoke(Method.java:580) ~[?:?] {} at MC-BOOTSTRAP/[email protected]/net.neoforged.fml.loading.targets.CommonLaunchHandler.runTarget(CommonLaunchHandler.java:136) ~[loader-4.0.23.jar%23139!/:4.0] {} at MC-BOOTSTRAP/[email protected]/net.neoforged.fml.loading.targets.CommonLaunchHandler.clientService(CommonLaunchHandler.java:124) ~[loader-4.0.23.jar%23139!/:4.0] {} at MC-BOOTSTRAP/[email protected]/net.neoforged.fml.loading.targets.NeoForgeClientUserdevLaunchHandler.runService(NeoForgeClientUserdevLaunchHandler.java:23) ~[loader-4.0.23.jar%23139!/:4.0] {} at MC-BOOTSTRAP/[email protected]/net.neoforged.fml.loading.targets.CommonLaunchHandler.lambda$launchService$4(CommonLaunchHandler.java:118) ~[loader-4.0.23.jar%23139!/:4.0] {} at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:30) [modlauncher-11.0.4.jar%23121!/:?] {} at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:53) [modlauncher-11.0.4.jar%23121!/:?] {} at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:71) [modlauncher-11.0.4.jar%23121!/:?] {} at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.Launcher.run(Launcher.java:103) [modlauncher-11.0.4.jar%23121!/:?] {} at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.Launcher.main(Launcher.java:74) [modlauncher-11.0.4.jar%23121!/:?] {} at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:26) [modlauncher-11.0.4.jar%23121!/:?] {} at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:23) [modlauncher-11.0.4.jar%23121!/:?] {} at [email protected]/cpw.mods.bootstraplauncher.BootstrapLauncher.run(BootstrapLauncher.java:210) [bootstraplauncher-2.0.2.jar:?] {} at [email protected]/cpw.mods.bootstraplauncher.BootstrapLauncher.main(BootstrapLauncher.java:69) [bootstraplauncher-2.0.2.jar:?] {} at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) ~[?:?] {} at java.base/java.lang.reflect.Method.invoke(Method.java:580) ~[?:?] {} at [email protected]/net.neoforged.devlaunch.Main.main(Main.java:55) [DevLaunch-1.0.1.jar:?] {} Caused by: java.lang.NullPointerException: Cannot invoke "net.minecraft.world.entity.player.Player.getData(net.neoforged.neoforge.attachment.AttachmentType)" because "player" is null at TRANSFORMER/[email protected]/com.tiviacz.travelersbackpack.capability.AttachmentUtils.getAttachment(AttachmentUtils.java:21) ~[travelersbackpack-e2aP2Euz.jar%23187!/:?] {re:classloading} at TRANSFORMER/[email protected]/com.tiviacz.travelersbackpack.network.ClientboundSyncAttachmentPacket.lambda$handle$2(ClientboundSyncAttachmentPacket.java:38) ~[travelersbackpack-e2aP2Euz.jar%23187!/:?] {re:classloading} at TRANSFORMER/[email protected]/net.neoforged.neoforge.network.handling.ClientPayloadContext.enqueueWork(ClientPayloadContext.java:31) ~[neoforge-21.0.167-minecraft-merged.jar%23184!/:?] {re:classloading} at TRANSFORMER/[email protected]/com.tiviacz.travelersbackpack.network.ClientboundSyncAttachmentPacket.handle(ClientboundSyncAttachmentPacket.java:34) ~[travelersbackpack-e2aP2Euz.jar%23187!/:?] {re:classloading} at TRANSFORMER/[email protected]/net.neoforged.neoforge.network.handling.MainThreadPayloadHandler.lambda$handle$0(MainThreadPayloadHandler.java:16) ~[neoforge-21.0.167-minecraft-merged.jar%23184!/:?] {re:classloading} at TRANSFORMER/[email protected]/net.minecraft.util.thread.BlockableEventLoop.lambda$submitAsync$0(BlockableEventLoop.java:60) ~[neoforge-21.0.167-minecraft-merged.jar%23183!/:?] {re:classloading,pl:accesstransformer:B} at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run$$$capture(CompletableFuture.java:1768) ~[?:?] {} ... 26 more
I'm assuming it's probably because the newPlayer here hasn't been added to the world yet causing the playerEntity to be null.
final Player playerEntity = (Player) Minecraft.getInstance().player.level().getEntity(message.entityID); ITravelersBackpack data = AttachmentUtils.getAttachment(playerEntity).orElseThrow(() -> new RuntimeException("No player attachment data found!"));
Hi there. I'm trying to use backpacks and soulbound in my modpack, but i realy can't
-
InvalidInjectionException: The specific error is that an injection point defined in a mixin could not find its target method. In this case, the method onPlayerDeath in BackpackUtils could not be found.
-
Caused by: The root cause of the error is the failure of the @Inject annotation on the handleOnPlayerDeath method due to the absence of the target method onPlayerDeath.
Hy
NeoForge-1.21-10.0.5
Hello, I'm a developer of the Soulbound mod.
I'm testing my mod with your mod (NeoForge-1.21-10.0.5) and the game throws an exception when calling the following code inPlayerEvent.Clone
event, but the game does not crash:
I'm not sure if it's appropriate to call this method when copying a player. Is this considered a bug?iTravelersBackpack.synchronise(); iTravelersBackpack.synchroniseToOthers(newPlayer);
[20:47:26] [Render thread/ERROR] [minecraft/BlockableEventLoop]: Error executing task on Client java.util.concurrent.CompletionException: java.lang.NullPointerException: Cannot invoke "net.minecraft.world.entity.player.Player.getData(net.neoforged.neoforge.attachment.AttachmentType)" because "player" is null at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:315) ~[?:?] {} at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:320) ~[?:?] {} at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run$$$capture(CompletableFuture.java:1770) ~[?:?] {} at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java) ~[?:?] {} at TRANSFORMER/[email protected]/net.minecraft.util.thread.BlockableEventLoop.doRunTask(BlockableEventLoop.java:151) ~[neoforge-21.0.167-minecraft-merged.jar%23183!/:?] {re:classloading,pl:accesstransformer:B} at TRANSFORMER/[email protected]/net.minecraft.util.thread.ReentrantBlockableEventLoop.doRunTask(ReentrantBlockableEventLoop.java:24) ~[neoforge-21.0.167-minecraft-merged.jar%23183!/:?] {re:classloading} at TRANSFORMER/[email protected]/net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:122) ~[neoforge-21.0.167-minecraft-merged.jar%23183!/:?] {re:classloading,pl:accesstransformer:B} at TRANSFORMER/[email protected]/net.minecraft.util.thread.BlockableEventLoop.runAllTasks(BlockableEventLoop.java:111) ~[neoforge-21.0.167-minecraft-merged.jar%23183!/:?] {re:classloading,pl:accesstransformer:B} at TRANSFORMER/[email protected]/net.minecraft.client.Minecraft.runTick(Minecraft.java:1161) ~[neoforge-21.0.167-minecraft-merged.jar%23183!/:?] {re:classloading,pl:runtimedistcleaner:A} at TRANSFORMER/[email protected]/net.minecraft.client.Minecraft.run(Minecraft.java:813) ~[neoforge-21.0.167-minecraft-merged.jar%23183!/:?] {re:classloading,pl:runtimedistcleaner:A} at TRANSFORMER/[email protected]/net.minecraft.client.main.Main.main(Main.java:230) ~[neoforge-21.0.167-minecraft-merged.jar%23183!/:?] {re:classloading,pl:runtimedistcleaner:A} at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) ~[?:?] {} at java.base/java.lang.reflect.Method.invoke(Method.java:580) ~[?:?] {} at MC-BOOTSTRAP/[email protected]/net.neoforged.fml.loading.targets.CommonLaunchHandler.runTarget(CommonLaunchHandler.java:136) ~[loader-4.0.23.jar%23139!/:4.0] {} at MC-BOOTSTRAP/[email protected]/net.neoforged.fml.loading.targets.CommonLaunchHandler.clientService(CommonLaunchHandler.java:124) ~[loader-4.0.23.jar%23139!/:4.0] {} at MC-BOOTSTRAP/[email protected]/net.neoforged.fml.loading.targets.NeoForgeClientUserdevLaunchHandler.runService(NeoForgeClientUserdevLaunchHandler.java:23) ~[loader-4.0.23.jar%23139!/:4.0] {} at MC-BOOTSTRAP/[email protected]/net.neoforged.fml.loading.targets.CommonLaunchHandler.lambda$launchService$4(CommonLaunchHandler.java:118) ~[loader-4.0.23.jar%23139!/:4.0] {} at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:30) [modlauncher-11.0.4.jar%23121!/:?] {} at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:53) [modlauncher-11.0.4.jar%23121!/:?] {} at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:71) [modlauncher-11.0.4.jar%23121!/:?] {} at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.Launcher.run(Launcher.java:103) [modlauncher-11.0.4.jar%23121!/:?] {} at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.Launcher.main(Launcher.java:74) [modlauncher-11.0.4.jar%23121!/:?] {} at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:26) [modlauncher-11.0.4.jar%23121!/:?] {} at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:23) [modlauncher-11.0.4.jar%23121!/:?] {} at [email protected]/cpw.mods.bootstraplauncher.BootstrapLauncher.run(BootstrapLauncher.java:210) [bootstraplauncher-2.0.2.jar:?] {} at [email protected]/cpw.mods.bootstraplauncher.BootstrapLauncher.main(BootstrapLauncher.java:69) [bootstraplauncher-2.0.2.jar:?] {} at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) ~[?:?] {} at java.base/java.lang.reflect.Method.invoke(Method.java:580) ~[?:?] {} at [email protected]/net.neoforged.devlaunch.Main.main(Main.java:55) [DevLaunch-1.0.1.jar:?] {} Caused by: java.lang.NullPointerException: Cannot invoke "net.minecraft.world.entity.player.Player.getData(net.neoforged.neoforge.attachment.AttachmentType)" because "player" is null at TRANSFORMER/[email protected]/com.tiviacz.travelersbackpack.capability.AttachmentUtils.getAttachment(AttachmentUtils.java:21) ~[travelersbackpack-e2aP2Euz.jar%23187!/:?] {re:classloading} at TRANSFORMER/[email protected]/com.tiviacz.travelersbackpack.network.ClientboundSyncAttachmentPacket.lambda$handle$2(ClientboundSyncAttachmentPacket.java:38) ~[travelersbackpack-e2aP2Euz.jar%23187!/:?] {re:classloading} at TRANSFORMER/[email protected]/net.neoforged.neoforge.network.handling.ClientPayloadContext.enqueueWork(ClientPayloadContext.java:31) ~[neoforge-21.0.167-minecraft-merged.jar%23184!/:?] {re:classloading} at TRANSFORMER/[email protected]/com.tiviacz.travelersbackpack.network.ClientboundSyncAttachmentPacket.handle(ClientboundSyncAttachmentPacket.java:34) ~[travelersbackpack-e2aP2Euz.jar%23187!/:?] {re:classloading} at TRANSFORMER/[email protected]/net.neoforged.neoforge.network.handling.MainThreadPayloadHandler.lambda$handle$0(MainThreadPayloadHandler.java:16) ~[neoforge-21.0.167-minecraft-merged.jar%23184!/:?] {re:classloading} at TRANSFORMER/[email protected]/net.minecraft.util.thread.BlockableEventLoop.lambda$submitAsync$0(BlockableEventLoop.java:60) ~[neoforge-21.0.167-minecraft-merged.jar%23183!/:?] {re:classloading,pl:accesstransformer:B} at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run$$$capture(CompletableFuture.java:1768) ~[?:?] {} ... 26 more [20:47:30] [Render thread/ERROR] [ne.ne.ne.ne.re.NetworkRegistry/]: Failed to process a synchronized task of the payload: travelersbackpack:sync_attachment java.util.concurrent.CompletionException: java.lang.NullPointerException: Cannot invoke "net.minecraft.world.entity.player.Player.getData(net.neoforged.neoforge.attachment.AttachmentType)" because "player" is null at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:315) ~[?:?] {} at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:320) ~[?:?] {} at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run$$$capture(CompletableFuture.java:1770) ~[?:?] {} at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java) ~[?:?] {} at TRANSFORMER/[email protected]/net.minecraft.util.thread.BlockableEventLoop.doRunTask(BlockableEventLoop.java:151) ~[neoforge-21.0.167-minecraft-merged.jar%23183!/:?] {re:classloading,pl:accesstransformer:B} at TRANSFORMER/[email protected]/net.minecraft.util.thread.ReentrantBlockableEventLoop.doRunTask(ReentrantBlockableEventLoop.java:24) ~[neoforge-21.0.167-minecraft-merged.jar%23183!/:?] {re:classloading} at TRANSFORMER/[email protected]/net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:122) ~[neoforge-21.0.167-minecraft-merged.jar%23183!/:?] {re:classloading,pl:accesstransformer:B} at TRANSFORMER/[email protected]/net.minecraft.util.thread.BlockableEventLoop.runAllTasks(BlockableEventLoop.java:111) ~[neoforge-21.0.167-minecraft-merged.jar%23183!/:?] {re:classloading,pl:accesstransformer:B} at TRANSFORMER/[email protected]/net.minecraft.client.Minecraft.runTick(Minecraft.java:1161) ~[neoforge-21.0.167-minecraft-merged.jar%23183!/:?] {re:classloading,pl:runtimedistcleaner:A} at TRANSFORMER/[email protected]/net.minecraft.client.Minecraft.run(Minecraft.java:813) ~[neoforge-21.0.167-minecraft-merged.jar%23183!/:?] {re:classloading,pl:runtimedistcleaner:A} at TRANSFORMER/[email protected]/net.minecraft.client.main.Main.main(Main.java:230) ~[neoforge-21.0.167-minecraft-merged.jar%23183!/:?] {re:classloading,pl:runtimedistcleaner:A} at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) ~[?:?] {} at java.base/java.lang.reflect.Method.invoke(Method.java:580) ~[?:?] {} at MC-BOOTSTRAP/[email protected]/net.neoforged.fml.loading.targets.CommonLaunchHandler.runTarget(CommonLaunchHandler.java:136) ~[loader-4.0.23.jar%23139!/:4.0] {} at MC-BOOTSTRAP/[email protected]/net.neoforged.fml.loading.targets.CommonLaunchHandler.clientService(CommonLaunchHandler.java:124) ~[loader-4.0.23.jar%23139!/:4.0] {} at MC-BOOTSTRAP/[email protected]/net.neoforged.fml.loading.targets.NeoForgeClientUserdevLaunchHandler.runService(NeoForgeClientUserdevLaunchHandler.java:23) ~[loader-4.0.23.jar%23139!/:4.0] {} at MC-BOOTSTRAP/[email protected]/net.neoforged.fml.loading.targets.CommonLaunchHandler.lambda$launchService$4(CommonLaunchHandler.java:118) ~[loader-4.0.23.jar%23139!/:4.0] {} at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:30) [modlauncher-11.0.4.jar%23121!/:?] {} at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:53) [modlauncher-11.0.4.jar%23121!/:?] {} at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:71) [modlauncher-11.0.4.jar%23121!/:?] {} at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.Launcher.run(Launcher.java:103) [modlauncher-11.0.4.jar%23121!/:?] {} at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.Launcher.main(Launcher.java:74) [modlauncher-11.0.4.jar%23121!/:?] {} at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:26) [modlauncher-11.0.4.jar%23121!/:?] {} at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:23) [modlauncher-11.0.4.jar%23121!/:?] {} at [email protected]/cpw.mods.bootstraplauncher.BootstrapLauncher.run(BootstrapLauncher.java:210) [bootstraplauncher-2.0.2.jar:?] {} at [email protected]/cpw.mods.bootstraplauncher.BootstrapLauncher.main(BootstrapLauncher.java:69) [bootstraplauncher-2.0.2.jar:?] {} at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) ~[?:?] {} at java.base/java.lang.reflect.Method.invoke(Method.java:580) ~[?:?] {} at [email protected]/net.neoforged.devlaunch.Main.main(Main.java:55) [DevLaunch-1.0.1.jar:?] {} Caused by: java.lang.NullPointerException: Cannot invoke "net.minecraft.world.entity.player.Player.getData(net.neoforged.neoforge.attachment.AttachmentType)" because "player" is null at TRANSFORMER/[email protected]/com.tiviacz.travelersbackpack.capability.AttachmentUtils.getAttachment(AttachmentUtils.java:21) ~[travelersbackpack-e2aP2Euz.jar%23187!/:?] {re:classloading} at TRANSFORMER/[email protected]/com.tiviacz.travelersbackpack.network.ClientboundSyncAttachmentPacket.lambda$handle$2(ClientboundSyncAttachmentPacket.java:38) ~[travelersbackpack-e2aP2Euz.jar%23187!/:?] {re:classloading} at TRANSFORMER/[email protected]/net.neoforged.neoforge.network.handling.ClientPayloadContext.enqueueWork(ClientPayloadContext.java:31) ~[neoforge-21.0.167-minecraft-merged.jar%23184!/:?] {re:classloading} at TRANSFORMER/[email protected]/com.tiviacz.travelersbackpack.network.ClientboundSyncAttachmentPacket.handle(ClientboundSyncAttachmentPacket.java:34) ~[travelersbackpack-e2aP2Euz.jar%23187!/:?] {re:classloading} at TRANSFORMER/[email protected]/net.neoforged.neoforge.network.handling.MainThreadPayloadHandler.lambda$handle$0(MainThreadPayloadHandler.java:16) ~[neoforge-21.0.167-minecraft-merged.jar%23184!/:?] {re:classloading} at TRANSFORMER/[email protected]/net.minecraft.util.thread.BlockableEventLoop.lambda$submitAsync$0(BlockableEventLoop.java:60) ~[neoforge-21.0.167-minecraft-merged.jar%23183!/:?] {re:classloading,pl:accesstransformer:B} at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run$$$capture(CompletableFuture.java:1768) ~[?:?] {} ... 26 more
I'm assuming it's probably because the newPlayer here hasn't been added to the world yet causing the playerEntity to be null.
final Player playerEntity = (Player) Minecraft.getInstance().player.level().getEntity(message.entityID); ITravelersBackpack data = AttachmentUtils.getAttachment(playerEntity).orElseThrow(() -> new RuntimeException("No player attachment data found!"));
Hi there. I'm trying to use backpacks and soulbound in my modpack, but i realy can't
- InvalidInjectionException: The specific error is that an injection point defined in a mixin could not find its target method. In this case, the method onPlayerDeath in BackpackUtils could not be found.
- Caused by: The root cause of the error is the failure of the @Inject annotation on the handleOnPlayerDeath method due to the absence of the target method onPlayerDeath.
I think it'll be better to open new issue or join discord for help
Hi there. I'm trying to use backpacks and soulbound in my modpack, but i realy can't
- InvalidInjectionException: The specific error is that an injection point defined in a mixin could not find its target method. In this case, the method onPlayerDeath in BackpackUtils could not be found.
- Caused by: The root cause of the error is the failure of the @Inject annotation on the handleOnPlayerDeath method due to the absence of the target method onPlayerDeath.
I think it'll be better to open new issue or join discord for help
i have found a solution i had to rollback from latest travelers backpack to the previous. I had some researches about that problem, and found that backpacks just #commented onPlayerDeath method used in soul bound code