A
Admincraft6mo ago
Mike

How to parse curly braces ({}) from a Pebble string?

I want to make a string variable that contains curly braces as it has nested PAPI variables but pebble is taking some of the braces out. Here's what I'm trying to parse:
randomYamlKey: |-
&4&m+ +
{% set req = 'placeholder#math_0:0_{statistic_mine_block:COAL_ORE}+{statistic_mine_block:DEEPSLATE_COAL_ORE}' %}
...then I would do things with this variable if it worked
&4&m+ +
randomYamlKey: |-
&4&m+ +
{% set req = 'placeholder#math_0:0_{statistic_mine_block:COAL_ORE}+{statistic_mine_block:DEEPSLATE_COAL_ORE}' %}
...then I would do things with this variable if it worked
&4&m+ +
When I use the string as a variable elsewhere it is parsed as placeholder#math_0:0_statistic_mine_block:COAL_ORE}+{statistic_mine_block:DEEPSLATE_COAL_ORE} missing the first {. I tried escaping the curly braces by using two instead of one but then I get the error: [18:39:46 WARN]: com.mitchellbosecke.pebble.error.ParserException: Unexpected character [&] for some reason. Maybe because pebble for some reason html encodes the curly brace? I've been trying for a long time now and would really appreciate guidance. Thanks in advance.
3 Replies
Admincraft Meta
Admincraft Meta6mo ago
Thanks for asking your question!
Make sure to provide as much helpful information as possible such as logs/what you tried and what your exact issue is
Make sure to mark solved when issue is solved!!!
/close !close !solved !answered
Requested by _earthcow#0
Mike
MikeOP6mo ago
!close
Admincraft Meta
Admincraft Meta6mo ago
post closed!
The post/thread has been closed!
Requested by _earthcow#0

Did you find this page helpful?