U Team Core

U Team Core

37M Downloads

[1.20 / 1.20.1] NPE for canBeDropped function

HyCraftHD opened this issue ยท 0 comments

commented

Bug description and reproduction steps

  • Use canBeDropper function in an UItem.
  • The player is null on fabric version

Log files and Screenshots

java.lang.NullPointerException: Cannot read field "containerMenu" because "player" is null
	at info.u_team.useful_backpacks.item.BackpackItem.canBeDropped(BackpackItem.java:86) ~[main/:?]
	at net.minecraft.server.level.ServerPlayer.handler$zme000$uteamcore$drop(ServerPlayer.java:4207) ~[minecraft-merged-project-@fabric-1.20.1-loom.mappings.1_20_1.layered+hash.528350982-v2.jar:?]
	at net.minecraft.server.level.ServerPlayer.drop(ServerPlayer.java) ~[minecraft-merged-project-@fabric-1.20.1-loom.mappings.1_20_1.layered+hash.528350982-v2.jar:?]
	at net.minecraft.server.network.ServerGamePacketListenerImpl.handlePlayerAction(ServerGamePacketListenerImpl.java:984) ~[minecraft-merged-project-@fabric-1.20.1-loom.mappings.1_20_1.layered+hash.528350982-v2.jar:?]
	at net.minecraft.network.protocol.game.ServerboundPlayerActionPacket.handle(ServerboundPlayerActionPacket.java:53) ~[minecraft-merged-project-@fabric-1.20.1-loom.mappings.1_20_1.layered+hash.528350982-v2.jar:?]
	at net.minecraft.network.protocol.game.ServerboundPlayerActionPacket.handle(ServerboundPlayerActionPacket.java:23) ~[minecraft-merged-project-@fabric-1.20.1-loom.mappings.1_20_1.layered+hash.528350982-v2.jar:?]
	at net.minecraft.network.protocol.PacketUtils.method_11072(PacketUtils.java:36) ~[minecraft-merged-project-@fabric-1.20.1-loom.mappings.1_20_1.layered+hash.528350982-v2.jar:?]
	at net.minecraft.server.TickTask.run(TickTask.java:25) ~[minecraft-merged-project-@fabric-1.20.1-loom.mappings.1_20_1.layered+hash.528350982-v2.jar:?]
	at net.minecraft.util.thread.BlockableEventLoop.doRunTask(BlockableEventLoop.java:152) ~[minecraft-merged-project-@fabric-1.20.1-loom.mappings.1_20_1.layered+hash.528350982-v2.jar:?]
	at net.minecraft.util.thread.ReentrantBlockableEventLoop.doRunTask(ReentrantBlockableEventLoop.java:29) ~[minecraft-merged-project-@fabric-1.20.1-loom.mappings.1_20_1.layered+hash.528350982-v2.jar:?]
	at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:737) ~[minecraft-merged-project-@fabric-1.20.1-loom.mappings.1_20_1.layered+hash.528350982-v2.jar:?]
	at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:1702) ~[minecraft-merged-project-@fabric-1.20.1-loom.mappings.1_20_1.layered+hash.528350982-v2.jar:?]
	at net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:126) ~[minecraft-merged-project-@fabric-1.20.1-loom.mappings.1_20_1.layered+hash.528350982-v2.jar:?]
	at net.minecraft.server.MinecraftServer.pollTaskInternal(MinecraftServer.java:722) ~[minecraft-merged-project-@fabric-1.20.1-loom.mappings.1_20_1.layered+hash.528350982-v2.jar:?]
	at net.minecraft.server.MinecraftServer.pollTask(MinecraftServer.java:718) ~[minecraft-merged-project-@fabric-1.20.1-loom.mappings.1_20_1.layered+hash.528350982-v2.jar:?]
	at net.minecraft.util.thread.BlockableEventLoop.runAllTasks(BlockableEventLoop.java:120) ~[minecraft-merged-project-@fabric-1.20.1-loom.mappings.1_20_1.layered+hash.528350982-v2.jar:?]
	at net.minecraft.server.MinecraftServer.waitUntilNextTick(MinecraftServer.java:700) ~[minecraft-merged-project-@fabric-1.20.1-loom.mappings.1_20_1.layered+hash.528350982-v2.jar:?]
	at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:637) ~[minecraft-merged-project-@fabric-1.20.1-loom.mappings.1_20_1.layered+hash.528350982-v2.jar:?]
	at net.minecraft.server.MinecraftServer.method_29739(MinecraftServer.java:270) ~[minecraft-merged-project-@fabric-1.20.1-loom.mappings.1_20_1.layered+hash.528350982-v2.jar:?]
	at java.lang.Thread.run(Thread.java:833) ~[?:?]

Used minecraft version

1.20.x

Used forge or fabric version

any 1.20 / 1.20.1

Used mod version

5.1.2.263