#Syntax Issue - How do I get a string in another string? (Solved)

1 messages · Page 1 of 1 (latest)

ancient drift
#

I have a hard question/problem (at least for me)
And I am going now to sleep defeated. But tomorrow I'll be back trying to fix this somehow.

In short:
How do I in a string set another string?

Context:
I'm using animation controller to give loot (due to having custom death animation).
and I have example:

            "death_loot_1": {
                "on_entry": [
                    "/loot spawn ~ ~ ~ loot "studio_addon/loot_file" ", //drops loot
                    "@s instant_despawn" //will make it despawn 
                ]
            },

that does not work

before I had this
"death_loot_1": {
"on_entry": [
"/loot spawn ~ ~ ~ loot loot_file", //drops loot
"@s instant_despawn" //will make it despawn
]
},
And this works fine

But I'm trying to set everything as neatly as possible so I have the loot inside loot_tables\studio_addon\loot_file

Inside Minecraft doing /loot spawn ~ ~ ~ loot "studio_addon\loot_file" works fine
and but inside the code it doesn't

I looked it up and I saw that using \ before the " make it so the code ignores the "
since using \ " makes it invisible inside conde AND later in the command. so the loot is never dropped

My diagnostic:
I think the problem is in the " " inside the other " "

My perfect solution:
A symbol (I'm inventing for the sake of a example) like ¬ that before the " the code(animation controller) ignores the first time it sees but removes, so then a second time(command) it recognize the " and the command inside is able to run.

Any help is greatly appreciated.
Thx in advance to anyone willing to help me

ancient drift
#

Syntax Issue - How do I get a string in another string? (Solved)