mojira.dev
MC-155904

Lock NBT tag opens depending on the client's interpretation of the key item's string

If there is a container with the NBT of Lock:"String", the container is able to be opened either with an item with the NBT:

{display:{Name:'{"text":"String"}'}}

or with a translation that sets the key to the string "String":

{display:{Name:'{"translate":"test.the_key"}'}}

With this example, the container opens perfectly fine in English languages, but if a translation were to be set in another language, it would not work because the client checks if the strings match and they would fail.

 

Instead, the server should do the checks so the player cannot exploit this and modify their translations for an items string to open a container before they have a key.

Comments 1

The server does indeed handle the check, you can test as follows:

/setblock ~ ~ ~ chest{Lock:Apple}
/setblock ~1 ~ ~ chest{Lock:Appel}
/give @p stone{display:{Name:'{"translate":"item.minecraft.apple"}'}}

Do those commands on a server and switch to Afrikaans language; only the first chest will be openable, as the English server handles the check

Jayceebee

(Unassigned)

Confirmed

(Unassigned)

Minecraft 1.14.3, Minecraft 1.14.4 Pre-Release 1, Minecraft 1.14.4 Pre-Release 2, Minecraft 1.14.4 Pre-Release 3, Minecraft 1.14.4 Pre-Release 5, Minecraft 1.14.4 Pre-Release 6, 1.14.4

Retrieved