Skript

Skript

743k Downloads

can't write single quote in item nbt

CirrusPreeminent opened this issue · 1 comments

commented

Skript/Server Version

Server Version: git-Paper-196 (MC: 1.20.1)
Skript Version: 2.7.3 (skriptlang-github)

Bug Description

When I try to add single quote in item NBT there will be backslash () come out of nowhere

This is the script:

on pick up:
    send "test1"
    If event-item is stick:
        set {_e} to event-item
        send "test2"
        set {_test::*} to lore of {_e}
        send "%{_test::*}%"
        If lore of {_e} contains "&bเส้นใยแมงมุมมีความแข็ง":
            send "test3"  
            set {_nbt} to nbt compound of {_e}
            set {_oldnbt} to tag "display;Lore" of {_nbt}
            set {_newnbt} to "{""extra"":[{""text"":""""},{""bold"":false,""italic"":false,""underlined"":false,""strikethrough"":false,""obfuscated"":false,""color"":""white"",""text"":""""}],""text"":""""}', '{""extra"":[{""bold"":false,""italic"":false,""underlined"":false,""strikethrough"":false,""obfuscated"":false,""color"":""white"",""text"":""""}],""text"":""""}', '{""extra"":[{""bold"":false,""italic"":false,""underlined"":false,""strikethrough"":false,""obfuscated"":false,""color"":""dark_gray"",""text"":""[""},{""italic"":false,""color"":""white"",""text"":""ข้อมูลไอเทม""},{""italic"":false,""color"":""dark_gray"",""text"":""]""}],""text"":""}', '{""extra"":[{""bold"":false,""italic"":false,""underlined"":false,""strikethrough"":false,""obfuscated"":false,""color"":""aqua"",""text"":""เส้นใยแมงมุมมีความแข็ง""}],""text"":""""}', '{""extra"":[{""bold"":false,""italic"":false,""underlined"":false,""strikethrough"":false,""obfuscated"":false,""color"":""aqua"",""text"":""มากกว่าเหล็กกล้า""}],""text"":""""}', '{""extra"":[{""bold"":false,""italic"":false,""underlined"":false,""strikethrough"":false,""obfuscated"":false,""color"":""white"",""text"":""""}],""text"":""""}', '{""extra"":[{""bold"":false,""italic"":false,""underlined"":false,""strikethrough"":false,""obfuscated"":false,""color"":""yellow"",""text"":""ระดับ:""},{""italic"":false,""color"":""white"",""text"":""""},{""italic"":false,""text"":""""}],""text"":""""}"
            set tag "display;Lore" of nbt compound of event-item to {_newnbt}
        

This is the result of item NBT tag Lore after edit:

Lore: ['{"extra":[{"text":""},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"color":"white","text":""}],"text":""}\', \'{"extra":[{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"color":"white","text":""}],"text":""}\', \'{"extra":[{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"color":"dark_gray","text":"["},{"italic":false,"color":"white","text":"ข้อมูลไอเทม"},{"italic":false,"color":"dark_gray","text":"]"}],"text":"}\', \'{"extra":[{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"color":"aqua","text":"เส้นใยแมงมุมมีความแข็ง"}],"text":""}\', \'{"extra":[{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"color":"aqua","text":"มากกว่าเหล็กกล้า"}],"text":""}\', \'{"extra":[{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"color":"white","text":""}],"text":""}\', \'{"extra":[{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"color":"yellow","text":"ระดับ:"},{"italic":false,"color":"white","text":""},{"italic":false,"text":""}],"text":""}']}

From the result you can see that before every single quote, there will be a backslash() Infront of it where it not suppose to.

Expected Behavior

The result NBT shouldn't have back slash before single quote.

Steps to Reproduce

Change NBT of item and include single quote to it

Errors or Screenshots

No response

Other

No response

Agreement

  • I have read the guidelines above and affirm I am following them with this report.
commented

This is something you should be reporting to SkBee, if it is indeed actually a bug. Skript doesn't handle NBT stuff.