Dusk[Forge/Fabric]

Dusk[Forge/Fabric]

7M Downloads

[Bug]: Attempted to call Event#setCanceled() on a non-cancelable event of type: PlayerSleepInBedEvent

ChiefArug opened this issue ยท 1 comments

commented

Describe the bug you're experiencing

I help other people with their logs, and found this in one. It doesnt crash the game, but it is an error that shouldn't be happening

[Server thread/ERROR] [net.minecraft.network.protocol.PacketUtils/]: Failed to handle packet net.minecraft.network.protocol.game.ServerboundUseItemOnPacket@35b1e9dc, suppressing error
java.lang.UnsupportedOperationException: Attempted to call Event#setCanceled() on a non-cancelable event of type: net.minecraftforge.event.entity.player.PlayerSleepInBedEvent
	at net.minecraftforge.eventbus.api.Event.setCanceled(Event.java:92) ~[eventbus-6.0.5.jar%2352!/:?]
	at com.dusk.event.EventHandler.onPlayerSleep(EventHandler.java:84) ~[dusk-1.20.1-3.2.jar%23239!/:1.20.1-3.2]
	at com.dusk.event.__EventHandler_onPlayerSleep_PlayerSleepInBedEvent.invoke(.dynamic) ~[dusk-1.20.1-3.2.jar%23239!/:1.20.1-3.2]
	at net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:73) ~[eventbus-6.0.5.jar%2352!/:?]
	at net.minecraftforge.eventbus.EventBus.post(EventBus.java:315) ~[eventbus-6.0.5.jar%2352!/:?]
	at net.minecraftforge.eventbus.EventBus.post(EventBus.java:296) ~[eventbus-6.0.5.jar%2352!/:?]
	at net.minecraftforge.event.ForgeEventFactory.onPlayerSleepInBed(ForgeEventFactory.java:517) ~[forge-1.20.1-47.1.3-universal.jar%23320!/:?]
	at net.minecraft.server.level.ServerPlayer.m_7720_(ServerPlayer.java:842) ~[server-1.20.1-20230612.114412-srg.jar%23315!/:?]
	at net.minecraft.world.level.block.BedBlock.m_6227_(BedBlock.java:113) ~[server-1.20.1-20230612.114412-srg.jar%23315!/:?]
	at net.minecraft.world.level.block.state.BlockBehaviour$BlockStateBase.m_60664_(BlockBehaviour.java:778) ~[server-1.20.1-20230612.114412-srg.jar%23315!/:?]
	at net.minecraft.server.level.ServerPlayerGameMode.m_7179_(ServerPlayerGameMode.java:343) ~[server-1.20.1-20230612.114412-srg.jar%23315!/:?]
	at net.minecraft.server.network.ServerGamePacketListenerImpl.m_6371_(ServerGamePacketListenerImpl.java:1055) ~[server-1.20.1-20230612.114412-srg.jar%23315!/:?]
	at net.minecraft.network.protocol.game.ServerboundUseItemOnPacket.m_5797_(ServerboundUseItemOnPacket.java:34) ~[server-1.20.1-20230612.114412-srg.jar%23315!/:?]
	at net.minecraft.network.protocol.game.ServerboundUseItemOnPacket.m_5797_(ServerboundUseItemOnPacket.java:8) ~[server-1.20.1-20230612.114412-srg.jar%23315!/:?]
	at net.minecraft.network.protocol.PacketUtils.m_263899_(PacketUtils.java:22) ~[server-1.20.1-20230612.114412-srg.jar%23315!/:?]
	at net.minecraft.server.TickTask.run(TickTask.java:18) ~[server-1.20.1-20230612.114412-srg.jar%23315!/:?]
	at net.minecraft.util.thread.BlockableEventLoop.m_6367_(BlockableEventLoop.java:156) ~[server-1.20.1-20230612.114412-srg.jar%23315!/:?]
	at net.minecraft.util.thread.ReentrantBlockableEventLoop.m_6367_(ReentrantBlockableEventLoop.java:23) ~[server-1.20.1-20230612.114412-srg.jar%23315!/:?]
	at net.minecraft.server.MinecraftServer.m_6367_(MinecraftServer.java:770) ~[server-1.20.1-20230612.114412-srg.jar%23315!/:?]
	at net.minecraft.server.MinecraftServer.m_6367_(MinecraftServer.java:161) ~[server-1.20.1-20230612.114412-srg.jar%23315!/:?]
	at net.minecraft.util.thread.BlockableEventLoop.m_7245_(BlockableEventLoop.java:130) ~[server-1.20.1-20230612.114412-srg.jar%23315!/:?]
	at net.minecraft.server.MinecraftServer.m_129961_(MinecraftServer.java:753) ~[server-1.20.1-20230612.114412-srg.jar%23315!/:?]
	at net.minecraft.server.MinecraftServer.m_7245_(MinecraftServer.java:747) ~[server-1.20.1-20230612.114412-srg.jar%23315!/:?]
	at net.minecraft.util.thread.BlockableEventLoop.m_18701_(BlockableEventLoop.java:139) ~[server-1.20.1-20230612.114412-srg.jar%23315!/:?]
	at net.minecraft.server.MinecraftServer.m_130012_(MinecraftServer.java:733) ~[server-1.20.1-20230612.114412-srg.jar%23315!/:?]
	at net.minecraft.server.MinecraftServer.m_130011_(MinecraftServer.java:665) ~[server-1.20.1-20230612.114412-srg.jar%23315!/:?]
	at net.minecraft.server.MinecraftServer.m_206580_(MinecraftServer.java:251) ~[server-1.20.1-20230612.114412-srg.jar%23315!/:?]
	at java.lang.Thread.run(Thread.java:833) ~[?:?]

Reproducability

I'm guessing you need to sleep in a bed, or otherwise trigger the event.

Mod up to date

  • Before submitting this issue I updated to the newest version and reproduced it

Minecraft version

1.20.1

Modloader version

Forge

Logs

its not my log to share, and I know the stacktrace has all the info you need.

commented

fixed in 3.3