Lack of escape sequences of newlines prevents quoted strings from containing newlines in a function
The bug
Though quoted strings in commands do not allow escape sequences except for backslash, \"(for double-quoted strings) and \'(for single-quoted strings), they can still contain control characters by embedding them directly and can represent any string in a command block.
However, this does not hold in a function since line feed (U+000A) and carriage return (U+000D) work as a command separator. Valid contents of quoted strings vary with the context: /.*/ in a command block and /[^\n\r]*/ in a function, in regex.
This inconsistency will be resolved by adding escape sequences of newlines.
Affected commands
/datapack enable "\n"→
Invalid escape sequence '\n' in quoted string ... enable "\n"<--[HERE]/data modify storage _ _ set value "\r"→
Invalid escape sequence '\r' in quoted string ...t value "\r"<--[HERE]
Linked Issues
- Unresolved
intsuc- 11
- 5
- Confirmed
- Commands
- nbt
1.15.2 - 25w04a
1.15.2 20w08a 20w09a 20w10a 20w11a 20w12a 20w14a 20w16a 20w17a 20w18a 20w20b 1.16-pre5 1.16.1 1.16.2-pre1 1.16.2 1.16.3 1.16.4-pre1 1.16.4 20w45a 20w46a 20w48a 20w49a 20w51a 21w03a 1.16.5 21w10a 21w11a 21w13a 21w15a 21w16a 21w19a 1.17-pre1 1.17 1.17.1 21w37a 1.18.1 22w03a 1.18.2-pre1 1.18.2 22w11a 22w12a 1.19.1 1.19.2 1.19.3-rc1 1.19.3 23w03a 23w05a 1.19.4 23w18a 1.20.1 23w31a 1.20.2 23w42a 24w03a 24w04a 24w33a 1.21.1 1.21.4 25w04a
Created Issue:
Lack of escape sequences of newlines prevents NBT strings from containing newlines in a function
The bug
Though NBT strings in minecraft:nbt_tag arguments do not allow escape sequences except for
}}, {{\"(for double-quoted strings) and \'(for single-quoted strings), they can still contain directly embedded control characters and can represent any string in a command block.
However, this does not hold in a function since the newlines \n and \r work as a command separator. Validities of NBT strings depends on the context: /./ in a command block and /[^\n\r]/ in a function in regex. This inconsistency will be resolved by adding escape sequences of newlines.How to reproduce
/data modify storage _ _ set value "\n"→
Invalid escape sequence '\n' in quoted string ...t value "\n"<--[HERE]
/data modify storage _ _ set value "\r"→
Invalid escape sequence '\r' in quoted string ...t value "\r"<--[HERE]
The bug
Though NBT strings in minecraft:nbt_tag arguments do not allow escape sequences except for
}}, {{\"(for double-quoted strings) and \'(for single-quoted strings), they can still contain directly embedded control characters and can represent any string in a command block.
However, this does not hold in a function since the newlines \n and \r work as a command separator. Validities of NBT strings depends on the context: /./ in a command block and /[^\n\r]/ in a function in regex. This inconsistency will be resolved by adding escape sequences of newlines.How to reproduce
/data modify storage _ _ set value "\n"→
Invalid escape sequence '\n' in quoted string ...t value "\n"<--[HERE]
/data modify storage _ _ set value "\r"→
Invalid escape sequence '\r' in quoted string ...t value "\r"<--[HERE]
The bug
Though NBT strings in minecraft:nbt_tag arguments do not allow escape sequences except for
, \"(for double-quoted strings) and \'(for single-quoted strings), they can still contain directly embedded control characters and can represent any string in a command block.
However, this does not hold in a function since the newlines \n and \r work as a command separator. Validities of NBT strings depends on the context: /./ in a command block and /[^\n\r]/ in a function in regex. This inconsistency will be resolved by adding escape sequences of newlines.How to reproduce
/data modify storage _ _ set value "\n"→
Invalid escape sequence '\n' in quoted string ...t value "\n"<--[HERE]
/data modify storage _ _ set value "\r"→
Invalid escape sequence '\r' in quoted string ...t value "\r"<--[HERE]
The bug
Though NBT strings in minecraft:nbt_tag arguments do not allow escape sequences except for
, \"(for double-quoted strings) and \'(for single-quoted strings), they can still contain directly embedded control characters and can represent any string in a command block.
However, this does not hold in a function since the newlines \n and \r work as a command separator. Validities of NBT strings depends on the context: /./ in a command block and /[^\n\r]/ in a function in regex. This inconsistency will be resolved by adding escape sequences of newlines.How to reproduce
/data modify storage _ _ set value "\n"→
Invalid escape sequence '\n' in quoted string ...t value "\n"<--[HERE]
/data modify storage _ _ set value "\r"→
Invalid escape sequence '\r' in quoted string ...t value "\r"<--[HERE]
The bug
Though NBT strings in minecraft:nbt_tag arguments do not allow escape sequences except for \\\\, \"(for double-quoted strings) and \'(for single-quoted strings), they can still contain directly embedded control characters and can represent any string in a command block.
However, this does not hold in a function since the newlines \n and \r work as a command separator. Validities of NBT strings depends on the context: /.*/ in a command block and /[^\n\r]*/ in a function in regex. This inconsistency will be resolved by adding escape sequences of newlines.How to reproduce
/data modify storage _ _ set value "\n"→
Invalid escape sequence '\n' in quoted string ...t value "\n"<--[HERE]
/data modify storage _ _ set value "\r"→
Invalid escape sequence '\r' in quoted string ...t value "\r"<--[HERE]
The bug
Though NBT strings in minecraft:nbt_tag arguments do not allow escape sequences except for
\\\\,\"(for double-quoted strings) and \'(for single-quoted strings), they can still contain directly embedded control characters and can represent any string in a command block.
However, this does not hold in a function since the newlines \n and \r work as a command separator. Validities of NBT strings depends on the context: /.*/ in a command block and /[^\n\r]*/ in a function in regex. This inconsistency will be resolved by adding escape sequences of newlines.How to reproduce
/data modify storage _ _ set value "\n"→
Invalid escape sequence '\n' in quoted string ...t value "\n"<--[HERE]
/data modify storage _ _ set value "\r"→
Invalid escape sequence '\r' in quoted string ...t value "\r"<--[HERE]
The bug
Though NBT strings in minecraft:nbt_tag arguments do not allow escape sequences except for
, \"(for double-quoted strings) and \'(for single-quoted strings), they can still contain directly embedded control characters and can represent any string in a command block.
However, this does not hold in a function since the newlines \n and \r work as a command separator. Validities of NBT strings depends on the context: /./ in a command block and /[^\n\r]/ in a function in regex. This inconsistency will be resolved by adding escape sequences of newlines.How to reproduce
/data modify storage _ _ set value "\n"→
Invalid escape sequence '\n' in quoted string ...t value "\n"<--[HERE]
/data modify storage _ _ set value "\r"→
Invalid escape sequence '\r' in quoted string ...t value "\r"<--[HERE]
The bug
Though NBT strings in minecraft:nbt_tag arguments do not allow escape sequences except for
, \"(for double-quoted strings) and \'(for single-quoted strings), they can still contain directly embedded control characters and can represent any string in a command block.
However, this does not hold in a function since the newlines \n and \r work as a command separator. Validities of NBT strings depends on the context: /./ in a command block and /[^\n\r]/ in a function in regex. This inconsistency will be resolved by adding escape sequences of newlines.How to reproduce
/data modify storage _ _ set value "\n"→
Invalid escape sequence '\n' in quoted string ...t value "\n"<--[HERE]
/data modify storage _ _ set value "\r"→
Invalid escape sequence '\r' in quoted string ...t value "\r"<--[HERE]
The bug
Though NBT strings in minecraft:nbt_tag arguments do not allow escape sequences except for backslash, \"(for double-quoted strings) and \'(for single-quoted strings), they can still contain directly embedded control characters and can represent any string in a command block.
However, this does not hold in a function since the newlines \n and \r work as a command separator. Validities of NBT strings depends on the context: /.*/ in a command block and /[^\n\r]*/ in a function in regex. This inconsistency will be resolved by adding escape sequences of newlines.How to reproduce
/data modify storage _ _ set value "\n"→
Invalid escape sequence '\n' in quoted string ...t value "\n"<--[HERE]
/data modify storage _ _ set value "\r"→
Invalid escape sequence '\r' in quoted string ...t value "\r"<--[HERE]
The bug
Though NBT strings in minecraft:nbt_tag arguments do not allow escape sequences except for backslash, \"(for double-quoted strings) and \'(for single-quoted strings), they can still contain directly embedded control characters and can represent any string in a command block.
However, this does not hold in a function sincethe newlines\n and \r work as a command separator. Validities of NBT strings depends on the context: /.*/ in a command block and /[^\n\r]*/ in a function in regex. This inconsistency will be resolved by adding escape sequences of newlines.How to reproduce
/data modify storage _ _ set value "\n"→
Invalid escape sequence '\n' in quoted string ...t value "\n"<--[HERE]
/data modify storage _ _ set value "\r"→
Invalid escape sequence '\r' in quoted string ...t value "\r"<--[HERE]
The bug
Though NBT strings in minecraft:nbt_tag arguments do not allow escape sequences except for backslash, \"(for double-quoted strings) and \'(for single-quoted strings), they can still contain control characters by embedding them directly and can represent any string in a command block.
However, this does not hold in a function since line feed (U+000A) and carriage return (U+000D) work as a command separator. Valid NBT strings vary with the context: /./ in a command block and /[^\n\r]/ in a function, in regex.
This inconsistency will be resolved by adding escape sequences of newlines.
How to reproduce
/data modify storage _ _ set value "\n"→
Invalid escape sequence '\n' in quoted string ...t value "\n"<--[HERE]
/data modify storage _ _ set value "\r"→
Invalid escape sequence '\r' in quoted string ...t value "\r"<--[HERE]
The bug
Though NBT strings in minecraft:nbt_tag arguments do not allow escape sequences except for backslash, \"(for double-quoted strings) and \'(for single-quoted strings), they can still contain control characters by embedding them directly and can represent any string in a command block.
However, this does not hold in a function since line feed (U+000A) and carriage return (U+000D) work as a command separator. Valid NBT strings vary with the context: /./ in a command block and /[^\n\r]/ in a function, in regex.
This inconsistency will be resolved by adding escape sequences of newlines.
How to reproduce
/data modify storage _ _ set value "\n"→
Invalid escape sequence '\n' in quoted string ...t value "\n"<--[HERE]
/data modify storage _ _ set value "\r"→
Invalid escape sequence '\r' in quoted string ...t value "\r"<--[HERE]
The bug
Though NBT strings in minecraft:nbt_tag arguments do not allow escape sequences except for backslash, \"(for double-quoted strings) and \'(for single-quoted strings), they can still contain control characters by embedding them directly and can represent any string in a command block.
However, this does not hold in a function since line feed (U+000A) and carriage return (U+000D) work as a command separator. Valid NBT strings vary with the context: /.*/ in a command block and /[^\n\r]*/ in a function, in regex.
This inconsistency will be resolved by adding escape sequences of newlines.
How to reproduce
/data modify storage _ _ set value "\n"→
Invalid escape sequence '\n' in quoted string ...t value "\n"<--[HERE]
/data modify storage _ _ set value "\r"→
Invalid escape sequence '\r' in quoted string ...t value "\r"<--[HERE]
The bug
Though NBT strings in minecraft:nbt_tag
arguments do not allow escape sequences except for backslash, \"(for double-quoted strings) and \'(for single-quoted strings), they can still contain control characters by embedding them directly and can represent any string in a command block.However, this does not hold in a function since line feed (U+000A) and carriage return (U+000D) work as a command separator. Valid
NBTstrings vary with the context: /.*/ in a command block and /[^\n\r]*/ in a function, in regex.This inconsistency will be resolved by adding escape sequences of newlines.
How to reproduce
/data modify storage _ _ set value "\n"→
Invalid escape sequence '\n' in quoted string ...t value "\n"<--[HERE]
/data modify storage _ _ set value "\r"→
Invalid escape sequence '\r' in quoted string ...t value "\r"<--[HERE]
The bug
Though quoted strings in commands do not allow escape sequences except for backslash, \"(for double-quoted strings) and \'(for single-quoted strings), they can still contain control characters by embedding them directly and can represent any string in a command block.
However, this does not hold in a function since line feed (U+000A) and carriage return (U+000D) work as a command separator. Valid contents of quoted strings vary with the context: /.*/ in a command block and /[^\n\r]*/ in a function, in regex.
This inconsistency will be resolved by adding escape sequences of newlines.
How to reproduce
/datapack enable "\n"→
Invalid escape sequence '\n' in quoted string ... enable "\n"<--[HERE]
/data modify storage _ _ set value "\n"→
Invalid escape sequence '\n' in quoted string ...t value "\n"<--[HERE]
/data modify storage _ _ set value "\r"→
Invalid escape sequence '\r' in quoted string ...t value "\r"<--[HERE]
Lack of escape sequences of newlines preventsNBTstrings from containing newlines in a functionLack of escape sequences of newlines prevents quoted strings from containing newlines in a function
relates to
The bug
Though quoted strings in commands do not allow escape sequences except for backslash, \"(for double-quoted strings) and \'(for single-quoted strings), they can still contain control characters by embedding them directly and can represent any string in a command block.
However, this does not hold in a function since line feed (U+000A) and carriage return (U+000D) work as a command separator. Valid contents of quoted strings vary with the context: /.*/ in a command block and /[^\n\r]*/ in a function, in regex.
This inconsistency will be resolved by adding escape sequences of newlines.
How to reproduce
/datapack enable "\n"→
Invalid escape sequence '\n' in quoted string ... enable "\n"<--[HERE]
/data modify storage _ _ set value "\n"→
Invalid escape sequence '\
n' in quoted string ...t value "\n"<--[HERE] /data modify storage _ _ set value "\r"→
Invalid escape sequence '\r' in quoted string ...t value "\r"<--[HERE]
The bug
Though quoted strings in commands do not allow escape sequences except for backslash, \"(for double-quoted strings) and \'(for single-quoted strings), they can still contain control characters by embedding them directly and can represent any string in a command block.
However, this does not hold in a function since line feed (U+000A) and carriage return (U+000D) work as a command separator. Valid contents of quoted strings vary with the context: /.*/ in a command block and /[^\n\r]*/ in a function, in regex.
This inconsistency will be resolved by adding escape sequences of newlines.
Affected commands
/datapack enable "\n"→
Invalid escape sequence '\n' in quoted string ... enable "\n"<--[HERE]
/data modify storage _ _ set value "\r"→
Invalid escape sequence '\r' in quoted string ...t value "\r"<--[HERE]