RandomTP

RandomTP

265k Downloads

[BUG] PlayerTeleportEvent cannot be triggered asynchronously from another thread

Tommeh1 opened this issue ยท 2 comments

commented

Describe the bug
Upon trying to run the /rtp command the following error is triggered instead:

[28.04 03:04:56] [Server] [INFO] Error executing command.
[28.04 03:04:56] [Server] [WARN] java.lang.IllegalStateException: PlayerTeleportEvent cannot be triggered asynchronously from another thread.
[28.04 03:04:56] [Server] [WARN] 	at TRANSFORMER/forge@47.2.20/org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:581)
[28.04 03:04:56] [Server] [WARN] 	at TRANSFORMER/minecraft@1.20.1/net.minecraft.server.network.ServerGamePacketListenerImpl.teleport(ServerGamePacketListenerImpl.java:1379)
[28.04 03:04:56] [Server] [WARN] 	at TRANSFORMER/minecraft@1.20.1/net.minecraft.server.network.ServerGamePacketListenerImpl.teleport(ServerGamePacketListenerImpl.java:1354)
[28.04 03:04:56] [Server] [WARN] 	at TRANSFORMER/minecraft@1.20.1/net.minecraft.server.network.ServerGamePacketListenerImpl.m_9774_(ServerGamePacketListenerImpl.java:1350)
[28.04 03:04:56] [Server] [WARN] 	at TRANSFORMER/minecraft@1.20.1/net.minecraft.server.level.ServerPlayer.teleportTo(ServerPlayer.java:1820)
[28.04 03:04:56] [Server] [WARN] 	at TRANSFORMER/minecraft@1.20.1/net.minecraft.server.level.ServerPlayer.m_8999_(ServerPlayer.java:1808)
[28.04 03:04:56] [Server] [WARN] 	at TRANSFORMER/randomtp@8.0.0+1.20/com.gmail.picono435.randomtp.api.RandomTPAPI.randomTeleport(RandomTPAPI.java:103)
[28.04 03:04:56] [Server] [WARN] 	at TRANSFORMER/randomtp@8.0.0+1.20/com.gmail.picono435.randomtp.api.RandomTPAPI.randomTeleport(RandomTPAPI.java:30)
[28.04 03:04:56] [Server] [WARN] 	at TRANSFORMER/randomtp@8.0.0+1.20/com.gmail.picono435.randomtp.commands.RTPCommand.lambda$runCommand$4(RTPCommand.java:47)
[28.04 03:04:56] [Server] [WARN] 	at java.base/java.lang.Thread.run(Thread.java:833)
  • RandomTP version: 8.0.0+1.20
  • Minecraft Version: 1.20.1

Additional context
I believe that this is caused by Mohist, but would like to see a workaround implemented either way if possible.

commented

A custom version has been added to the pinned messages of discord implementing this fix for the unsupported version 1.20.1.

commented

A workaround has been implemented. It will be released as soon as possible.