Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-277765

Escaping of stored data is not returned

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • 1.21.2 Release Candidate 2
    • None
    • Unconfirmed
    • (Unassigned)

      When trying to refer to a previously stored CustomName from an Entity or minecraft:custom_name component from items with macro functions the returned value does not include escaping of special character like single quotation marks, which causes dynamic functions to break.

      So for example if I store the name of an entity which has "Bob's Burger" as a name with the command:

      /data modify storage test:storage saved_name set from entity @n[type=!player] CustomName

      It would then store the data as:

      saved_name: '"Bob\'s Burger"'

      But when I then try to use the stored data in a macro command it removes the escaping of the single quotation mark which causes the command/function to fail. Here's also an example of a command I've tried for testing:

      $execute as @a at @a if items entity @s container.* minecraft:goat_horn[minecraft:custom_data={wawo:goat_horn_tp},minecraft:custom_name='$(saved_name)'] run say success

      (Same happens with any other command when I use the variable and I've also tested it without the single quotation marks for the custom_name field)

            Unassigned Unassigned
            NiceRon NiceRon
            Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated: