Minecraft
  1. Minecraft
  2. MC-87739

/setblock with signs missing Text tags kicks all players loading the sign

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Resolution: Fixed
    • Affects Version/s: Minecraft 15w35d, Minecraft 15w35e, Minecraft 15w45a, Minecraft 15w51b, Minecraft 16w03a, Minecraft 16w04a, Minecraft 1.9, Minecraft 1.9.1, Minecraft 1.9.2, Minecraft 1.9.3 Pre-Release 1, Minecraft 1.9.3 Pre-Release 2, Minecraft 1.9.3 Pre-Release 3
    • Security Level: Minecraft - Public (Viewable by everyone)
    • Labels:
      None
    • Confirmation Status:
      Confirmed

      Description

      Warning: this bug is server-only.
      Place a command block (Impulse, Unconditionnal, Needs Redstone).
      Enter this command :

      setblock ~ ~1 ~ standing_sign 0 replace {Text1:"[{\"text\":\"Hey\"}]"}
      

      Place a redstone block next to this command block. Now everyone near this command_block is getting kicked from the server, with this error :

      Internal Exeption: io.netty.handler.codec.DecoderExeption:
      com.google.gson.JsonSyntaxExeption:
      com.google.gson.stream.MalformedJsonExeption: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 1
      

      Here is the consol log :

      TheMrZZ lost connection: TextComponent{text='Disconnected', siblings=[], style=Style{hasParent=false, color=null, bold=null, italic=null, underlined=null, obfuscated=null, clickEvent=null, hoverEvent=null, insertion=null}}
      

      Happens when alimented with a lever, a button (stone & wood), a repeater, a comparator, a redstone wire (any kind of alimentation works).

      BIGGEST PROBLEM : If you do this in a spawn chunk, you can't come back because it seems to instant-kick every player near the CM, except if someone put a command like /tp PLAYER @p in a repeating command block.

      See Marcono1234's comment for a description of why this happens

        Issue Links

          Activity

          Hide
          Sven added a comment - - edited

          So in 1.9.2 the crash OP described is (not really) gone BUT. You seriously screwed up JSON in minecraft. This command wants lenient syntax, one doesn't care and the other one again cares.

          So yes I can do this (non-lenient):

          /blockdata 111 64 -13 {"Text1": "Hello","Text2": "hello", "Text3":"hello", "Text4":"asd"}
          

          And it DOES update the block but then again, JSON screwup: It updates it so that I have a data tag with "Text1" AND just Text1 without quotes. Effectively not changing anything on the sign.

          [22:17:40] [Server thread/INFO]: [2called_chaos: Block data updated to: {"Text1":"Hello",x:111,Text4:"{\"text\":\"\"}",y:64,Text3:"{\"text\":\"\"}",z:-13,Text2:"{\"text\":\"\"}",id:"Sign",Text1:"{\"text\":\"\"}"}]
          

          With lenient syntax it still doesn't work:

          /blockdata 111 64 -13 {Text1: "Hello",Text2: "hello", Text3:"hello",Text4:"asd"}
          Client: "An unknown error occurred while attempting to perform this command"
          Server: [EVENT] [22:25:09] [Server thread/WARN]: Couldn't process command: 'blockdata 111 64 -13 {Text1: "Hello", Text2: "hello", Text3:"hello", Text4:"asd"}'
          

          Then if I try to use Text1: {} compound syntax:

          /blockdata 111 64 -13 {Text1: {"text": "Hello"}, Text2: {"text": "hellooooo"}, Text3: {"text": "rly"}, Text4: {"text": "cmon"}}
          

          Same thing as OP described (server crash + restart required)

          Let's try it one more time with complete non-lenient and text compounds...

          /blockdata 111 64 -13 {"Text1": {"text": "Hello"}, "Text2": {"text": "hellooooo"}, "Text3": {"text": "rly"}, "Text4": {"text": "cmon"}}
          

          Same thing as before, no error but double data tags (with and without quotes)...

          PS: By the way it doesn't matter if a user does this or a command block but due to all the required quotes you will almost always need a command block due to the ridiculous chat limitation (I get it for messages but allow longer commands or a command input chat thingy :>)

          Show
          Sven added a comment - - edited So in 1.9.2 the crash OP described is (not really) gone BUT. You seriously screwed up JSON in minecraft. This command wants lenient syntax, one doesn't care and the other one again cares. So yes I can do this (non-lenient): /blockdata 111 64 -13 { "Text1" : "Hello" , "Text2" : "hello" , "Text3" : "hello" , "Text4" : "asd" } And it DOES update the block but then again, JSON screwup: It updates it so that I have a data tag with "Text1" AND just Text1 without quotes. Effectively not changing anything on the sign. [22:17:40] [Server thread/INFO]: [2called_chaos: Block data updated to: { "Text1" : "Hello" ,x:111,Text4: "{\" text\ ":\" \ "}" ,y:64,Text3: "{\" text\ ":\" \ "}" ,z:-13,Text2: "{\" text\ ":\" \ "}" ,id: "Sign" ,Text1: "{\" text\ ":\" \ "}" }] With lenient syntax it still doesn't work: /blockdata 111 64 -13 {Text1: "Hello" ,Text2: "hello" , Text3: "hello" ,Text4: "asd" } Client: "An unknown error occurred while attempting to perform this command" Server: [EVENT] [22:25:09] [Server thread/WARN]: Couldn't process command: 'blockdata 111 64 -13 {Text1: "Hello" , Text2: "hello" , Text3: "hello" , Text4: "asd" }' Then if I try to use Text1: {} compound syntax: /blockdata 111 64 -13 {Text1: { "text" : "Hello" }, Text2: { "text" : "hellooooo" }, Text3: { "text" : "rly" }, Text4: { "text" : "cmon" }} Same thing as OP described (server crash + restart required) Let's try it one more time with complete non-lenient and text compounds... /blockdata 111 64 -13 { "Text1" : { "text" : "Hello" }, "Text2" : { "text" : "hellooooo" }, "Text3" : { "text" : "rly" }, "Text4" : { "text" : "cmon" }} Same thing as before, no error but double data tags (with and without quotes)... PS: By the way it doesn't matter if a user does this or a command block but due to all the required quotes you will almost always need a command block due to the ridiculous chat limitation (I get it for messages but allow longer commands or a command input chat thingy :>)
          Hide
          [Helper] Marcono1234 added a comment -

          Sven I think you are confusing NBT parsing and JSON parsing. The sign data is NBT which does not parsed quotes around the keys, which is why you get tags like "Text1" then instead of Text1. Quotes are needed for the JSON data of the lines because else the NBT parser would try to parse them (this is why "Text1: {} compound syntax" will not work). JSON parsing is in nearly no situation lenient anymore. NBT parsing is something different and has different rules (defined by Minecraft), but is sadly often confused with JSON.

          Show
          [Helper] Marcono1234 added a comment - Sven I think you are confusing NBT parsing and JSON parsing. The sign data is NBT which does not parsed quotes around the keys, which is why you get tags like "Text1" then instead of Text1 . Quotes are needed for the JSON data of the lines because else the NBT parser would try to parse them (this is why "Text1: {} compound syntax" will not work). JSON parsing is in nearly no situation lenient anymore. NBT parsing is something different and has different rules (defined by Minecraft), but is sadly often confused with JSON.
          Hide
          Sven added a comment -

          @Marcono1234 Well I guess that is because there is no way (without knowing) what is NBT and what is JSON. The reason for that might be that lenient-JSON and NBT look the exact same. I just tested this here in 1.9.2 and it works (you were right though that I have to put the JSON as string with all quotes escaped):

          /blockdata -231 72 213 {Text1:"{\"text\":\"hello\",\"color\":\"green\",\"bold\":true}"}
          

          So I just guess it is intended now that you cannot use the shorthand syntax anymore (e.g. Text1: "just text")
          I still think though that it is not intended that the server basically crashes when the command is wrong.

          Show
          Sven added a comment - @Marcono1234 Well I guess that is because there is no way (without knowing) what is NBT and what is JSON. The reason for that might be that lenient-JSON and NBT look the exact same. I just tested this here in 1.9.2 and it works (you were right though that I have to put the JSON as string with all quotes escaped): /blockdata -231 72 213 {Text1: "{\" text\ ":\" hello\ ",\" color\ ":\" green\ ",\" bold\ ": true }" } So I just guess it is intended now that you cannot use the shorthand syntax anymore (e.g. Text1: "just text" ) I still think though that it is not intended that the server basically crashes when the command is wrong.
          Hide
          [Mojang] Grum (Erik Broes) added a comment -

          Can someone confirm this is still happening in the latest 1.10 snapshot? the kind of packets changed since 1.9.3.

          Show
          [Mojang] Grum (Erik Broes) added a comment - Can someone confirm this is still happening in the latest 1.10 snapshot? the kind of packets changed since 1.9.3.
          Hide
          [Mod] FVbico (Steven Verberne) added a comment - - edited

          No longer appears to be an issue anymore in 16w20a, the sign gets placed (without text) and a message pops up saying:

          An unknown error occurred while attempting to preform this command

          Resolving as fixed for 16w20a.

          Show
          [Mod] FVbico (Steven Verberne) added a comment - - edited No longer appears to be an issue anymore in 16w20a, the sign gets placed (without text) and a message pops up saying: An unknown error occurred while attempting to preform this command Resolving as fixed for 16w20a.

            People

            • Assignee:
              [Mojang] Grum (Erik Broes)
              Reporter:
              TheMrZZ
            • Votes:
              11 Vote for this issue
              Watchers:
              13 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                CHK: