When giving a player on creative mode a sign with the following command
/give @p sign 10 0 {BlockEntityTag:{Text1:"1"}}
the sign will act strange. This will only occur when the value for Text1 is invalid JSON.
Once you have the sign, just place it down and see the number of signs in the stack go down to 1 in the stack, then MC-105982 blocks it.
Other tags I have tried didn't result in the issue occurring.
Upon dropping the negative signs, you can't pick them up (as I would expect with the way picking up items is processed)
Code analysis by @unknown can be found in this comment.
Linked issues
is duplicated by 1
Attachments
Comments 6
Please link to this comment in the description
The following is based on a decompiled version of Minecraft 1.9 using MCP 9.24 beta.
It looks like the reason why this happens is because the method net.minecraft.item.ItemSign.onItemUse(ItemStack, EntityPlayer, World, BlockPos, EnumHand, EnumFacing, float, float, float)
is not catching the exception. Because of this the methods net.minecraft.client.multiplayer.PlayerControllerMP.func_187099_a(EntityPlayerSP, WorldClient, ItemStack, BlockPos, EnumFacing, Vec3d, EnumHand)
and net.minecraft.server.management.PlayerInteractionManager.func_187251_a(EntityPlayer, World, ItemStack, EnumHand, BlockPos, EnumFacing, float, float, float)
cannot restore the item count and damage for creative players.
Fixed for 16w36a
If you place the sign, you get this error in logs:
[21:25:50] [Server thread/FATAL]: Error executing task
java.util.concurrent.ExecutionException: com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 1
at java.util.concurrent.FutureTask.report(FutureTask.java:122) ~[?:1.8.0_25]
at java.util.concurrent.FutureTask.get(FutureTask.java:192) ~[?:1.8.0_25]
at h.a(SourceFile:46) [16w36a.jar:?]
at net.minecraft.server.MinecraftServer.D(SourceFile:605) [16w36a.jar:?]
at net.minecraft.server.MinecraftServer.C(SourceFile:561) [16w36a.jar:?]
at cal.C(SourceFile:154) [16w36a.jar:?]
at net.minecraft.server.MinecraftServer.run(SourceFile:465) [16w36a.jar:?]
at java.lang.Thread.run(Thread.java:745) [?:1.8.0_25]
Caused by: com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 1
at com.google.gson.internal.Streams.parse(Streams.java:56) ~[gson-2.2.4.jar:?]
at com.google.gson.TreeTypeAdapter.read(TreeTypeAdapter.java:54) ~[gson-2.2.4.jar:?]
at oi.a(SourceFile:489) ~[16w36a.jar:?]
at oi.a(SourceFile:500) ~[16w36a.jar:?]
at fa$a.a(SourceFile:205) ~[16w36a.jar:?]
at arv.a(SourceFile:111) ~[16w36a.jar:?]
at add.a(SourceFile:91) ~[16w36a.jar:?]
at afp.a(SourceFile:55) ~[16w36a.jar:?]
at aer.a(SourceFile:177) ~[16w36a.jar:?]
at lx.a(SourceFile:340) ~[16w36a.jar:?]
at mg.a(SourceFile:624) ~[16w36a.jar:?]
at jl.a(SourceFile:55) ~[16w36a.jar:?]
at jl.a(SourceFile:11) ~[16w36a.jar:?]
at fn$1.run(SourceFile:13) ~[16w36a.jar:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[?:1.8.0_25]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_25]
at h.a(SourceFile:45) ~[16w36a.jar:?]
... 5 more
Caused by: com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 1
at com.google.gson.stream.JsonReader.syntaxError(JsonReader.java:1505) ~[gson-2.2.4.jar:?]
at com.google.gson.stream.JsonReader.checkLenient(JsonReader.java:1386) ~[gson-2.2.4.jar:?]
at com.google.gson.stream.JsonReader.doPeek(JsonReader.java:572) ~[gson-2.2.4.jar:?]
at com.google.gson.stream.JsonReader.peek(JsonReader.java:414) ~[gson-2.2.4.jar:?]
at com.google.gson.internal.Streams.parse(Streams.java:42) ~[gson-2.2.4.jar:?]
at com.google.gson.TreeTypeAdapter.read(TreeTypeAdapter.java:54) ~[gson-2.2.4.jar:?]
at oi.a(SourceFile:489) ~[16w36a.jar:?]
at oi.a(SourceFile:500) ~[16w36a.jar:?]
at fa$a.a(SourceFile:205) ~[16w36a.jar:?]
at arv.a(SourceFile:111) ~[16w36a.jar:?]
at add.a(SourceFile:91) ~[16w36a.jar:?]
at afp.a(SourceFile:55) ~[16w36a.jar:?]
at aer.a(SourceFile:177) ~[16w36a.jar:?]
at lx.a(SourceFile:340) ~[16w36a.jar:?]
at mg.a(SourceFile:624) ~[16w36a.jar:?]
at jl.a(SourceFile:55) ~[16w36a.jar:?]
at jl.a(SourceFile:11) ~[16w36a.jar:?]
at fn$1.run(SourceFile:13) ~[16w36a.jar:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[?:1.8.0_25]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_25]
at h.a(SourceFile:45) ~[16w36a.jar:?]
... 5 more
Confirmed for
16w15b