KubeJS (Old)

KubeJS (Old)

3M Downloads

Incorrect Escape Character Recognition

StarskyXIII opened this issue ยท 0 comments

commented

Minecraft Version

1.21.1

KubeJS Version

2101.7.1-build.181

Rhino Version

2101.2.7-build.74

Architectury Version

13.0.8

Forge/Fabric Version

NeoForge 21.1.122

Describe your issue

I am a translator and encountered an issue while localizing FTB Oceanblock 2.

This is a code snippet extracted from the Modpack's kubejs/server_scripts/loot/spawners.js:

    {
      name: "ftb:spawners/shadow",
      always: [
        ["ftb:abyssal_fragment", 1, [1, 2]],
        ["minecraft:ender_pearl", 1, [1, 4]],
      ],
      entries: [
        [
          'minecraft:sea_pickle[custom_name="{\"translate\":\"item.ftb.eldritch_pickle\"}",enchantments={levels:{"ftboceanmobs:rift_disruptor":5,unbreaking:10}}]',
          1000,
          [1, 1],
        ],
      ],
    },

Since this Item Component failed to apply correctly, I attempted to replace it with the following:

'minecraft:sea_pickle[custom_name="{\"translate\":\"item.ftb.eldritch_pickle\"}",enchantments={levels:{"ftboceanmobs:rift_disruptor":5,unbreaking:10}}]',

However, I received the following error:

[18:16:05] [ERROR] ! ItemStackJS.java#234: Error in 'LootJS.lootTables': java.lang.RuntimeException: com.mojang.brigadier.exceptions.CommandSyntaxException: Malformed 'minecraft:custom_name' component: 'java.io.EOFException: End of input at line 1 column 2 path $.' at position 33: ...stom_name=<--[HERE]
[18:16:05] [ERROR] ! java.lang.RuntimeException: com.mojang.brigadier.exceptions.CommandSyntaxException: Malformed 'minecraft:custom_name' component: 'java.io.EOFException: End of input at line 1 column 2 path $.' at position 33: ...stom_name=<--[HERE]

Crash report/logs

No response