Uploaded image for project: 'Spigot'
  1. Spigot
  2. SPIGOT-7123

NullPointerException thrown by Player#chat method

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • None
    • None
    • CraftBukkit version 3554-Spigot-2183145-6da8266 (MC: 1.19.1) (Implementing API version 1.19.1-R0.1-SNAPSHOT)
    • Yes

      When attempting to send a chat message as a player with the Player#chat method, a NullPointerException is thrown. It works fine with 1.19.

       

      java.lang.NullPointerException: Cannot invoke "net.minecraft.network.chat.PlayerChatMessage.f()" because "var0" is null
              at net.minecraft.network.chat.OutgoingPlayerChatMessage.a(SourceFile:23) ~[spigot-1.19.1-R0.1-SNAPSHOT.jar:3554-
      Spigot-2183145-6da8266]
              at net.minecraft.server.network.PlayerConnection.chat(PlayerConnection.java:2038) ~[spigot-1.19.1-R0.1-SNAPSHOT.
      jar:3554-Spigot-2183145-6da8266]
              at org.bukkit.craftbukkit.v1_19_R1.entity.CraftPlayer.chat(CraftPlayer.java:387) ~[spigot-1.19.1-R0.1-SNAPSHOT.j
      ar:3554-Spigot-2183145-6da8266]
              at io.github.mrcomputer1.chattest.ChatTest.onCommand(ChatTest.java:20) ~[?:?]
              at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[spigot-api-1.19.1-R0.1-SNAPSHOT.jar:?]
              at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:149) ~[spigot-api-1.19.1-R0.1-SNAPSHOT.jar
      :?]
              at org.bukkit.craftbukkit.v1_19_R1.CraftServer.dispatchCommand(CraftServer.java:831) ~[spigot-1.19.1-R0.1-SNAPSH
      OT.jar:3554-Spigot-2183145-6da8266]
              at org.bukkit.craftbukkit.v1_19_R1.command.BukkitCommandWrapper.run(BukkitCommandWrapper.java:44) ~[spigot-1.19.
      1-R0.1-SNAPSHOT.jar:3554-Spigot-2183145-6da8266]
              at com.mojang.brigadier.CommandDispatcher.execute(CommandDispatcher.java:264) ~[spigot-1.19.1-R0.1-SNAPSHOT.jar:
      ?]
              at net.minecraft.commands.CommandDispatcher.performCommand(CommandDispatcher.java:298) ~[spigot-1.19.1-R0.1-SNAP
      SHOT.jar:3554-Spigot-2183145-6da8266]
              at net.minecraft.commands.CommandDispatcher.a(CommandDispatcher.java:282) ~[spigot-1.19.1-R0.1-SNAPSHOT.jar:3554
      -Spigot-2183145-6da8266]
              at net.minecraft.server.network.PlayerConnection.b(PlayerConnection.java:1940) ~[spigot-1.19.1-R0.1-SNAPSHOT.jar
      :3554-Spigot-2183145-6da8266]
              at net.minecraft.server.network.PlayerConnection.lambda$18(PlayerConnection.java:1905) ~[spigot-1.19.1-R0.1-SNAP
      SHOT.jar:3554-Spigot-2183145-6da8266]
              at net.minecraft.util.thread.IAsyncTaskHandler.b(SourceFile:68) ~[spigot-1.19.1-R0.1-SNAPSHOT.jar:3554-Spigot-21
      83145-6da8266]
              at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768) ~[?:?]
              at net.minecraft.server.TickTask.run(SourceFile:18) ~[spigot-1.19.1-R0.1-SNAPSHOT.jar:3554-Spigot-2183145-6da826
      6]
              at net.minecraft.util.thread.IAsyncTaskHandler.d(SourceFile:157) ~[spigot-1.19.1-R0.1-SNAPSHOT.jar:3554-Spigot-2
      183145-6da8266]
              at net.minecraft.util.thread.IAsyncTaskHandlerReentrant.d(SourceFile:23) ~[spigot-1.19.1-R0.1-SNAPSHOT.jar:3554-
      Spigot-2183145-6da8266]
              at net.minecraft.server.MinecraftServer.b(MinecraftServer.java:1150) ~[spigot-1.19.1-R0.1-SNAPSHOT.jar:3554-Spig
      ot-2183145-6da8266]
              at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:1) ~[spigot-1.19.1-R0.1-SNAPSHOT.jar:3554-Spigot-
      2183145-6da8266]
              at net.minecraft.util.thread.IAsyncTaskHandler.x(SourceFile:131) ~[spigot-1.19.1-R0.1-SNAPSHOT.jar:3554-Spigot-2
      183145-6da8266]
              at net.minecraft.server.MinecraftServer.bh(MinecraftServer.java:1129) ~[spigot-1.19.1-R0.1-SNAPSHOT.jar:3554-Spi
      got-2183145-6da8266]
              at net.minecraft.server.MinecraftServer.x(MinecraftServer.java:1122) ~[spigot-1.19.1-R0.1-SNAPSHOT.jar:3554-Spig
      ot-2183145-6da8266]
              at net.minecraft.util.thread.IAsyncTaskHandler.c(SourceFile:140) ~[spigot-1.19.1-R0.1-SNAPSHOT.jar:3554-Spigot-2
      183145-6da8266]
              at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:1106) ~[spigot-1.19.1-R0.1-SNAPSHOT.jar:3554-Spig
      ot-2183145-6da8266]
              at net.minecraft.server.MinecraftServer.v(MinecraftServer.java:1017) ~[spigot-1.19.1-R0.1-SNAPSHOT.jar:3554-Spig
      ot-2183145-6da8266]
              at net.minecraft.server.MinecraftServer.lambda$0(MinecraftServer.java:293) ~[spigot-1.19.1-R0.1-SNAPSHOT.jar:355
      4-Spigot-2183145-6da8266]
              at java.lang.Thread.run(Thread.java:833) [?:?]

      A plugin showing this bug is attached, just do "/chattest".

            Unassigned Unassigned
            Mrcomputer1 Mrcomputer1
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: