Solved "command" syntax does not work with a long command

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

NameKun

Member
Mar 3, 2020
11
0
1
19
Hi.
I want the console to execute a long command like "give~",
so I made this and tried if it works.
However, it does not.

Code:
command /testcommand:
    trigger:
        command "give @p dragon_head{display:{Name:'[{"text":"Flies","color":"yellow"}]',Lore:['[{"text":"You get a speed of +0.05 when you are equipped on your head."}]','[{"text":"You can move more rapidly if you equip yourself for it.","italic":true}]','[{"text":"Not mosquitoes, but Flies.","italic":true}]']},AttributeModifiers:[{AttributeName:"generic.movement_speed",Amount:0.05,Operation:0,UUID:[I;-1201015,29915,174314,-59830],Slot:head,Name:"generic.movement_speed"}]} 1"

This is the code that causes an error.
Needless to say, on a command block, the command can work and can give a player the item.

63f5a698a23a191a0bdb2ade3a2f4387.png


And This is the error.
It says "Can't understand this effect".
A short command is acceptable, but a long command is not?
I don't know the difference between a shorter one and a longer one and how to fix this.

Could you help me with the correction?
(I'm not a native English speaker, so if there are mistakes, I'm sorry.)
 
Ofc ofc :emoji_wink:
Never seen the syntax Command before. Must be above 1.8 then.

But of what I can see, its because of "
It understands it as the end of the text.

Replace every single " with two of "

"" in skript means a single " INSIDE a text column.

Little hard to understand,

But here the working code is:

Code:
       command "give @p dragon_head{display:{Name:'[{""text"":""Flies"",""color"":""yellow""}]',Lore:['[{""text"":""You get a speed of +0.05 when you are equipped on your head.""}]','[{""text"":""You can move more rapidly if you equip yourself for it."",""italic"":true}]','[{""text"":""Not mosquitoes, but Flies."",""italic"":true}]']},AttributeModifiers:[{AttributeName:""generic.movement_speed"",Amount:0.05,Operation:0,UUID:[I;-1201015,29915,174314,-59830],Slot:head,Name:""generic.movement_speed""}]} 1"
 
Ofc ofc :emoji_wink:
Never seen the syntax Command before. Must be above 1.8 then.

But of what I can see, its because of "
It understands it as the end of the text.

Replace every single " with two of "

"" in skript means a single " INSIDE a text column.

Little hard to understand,

But here the working code is:

Code:
       command "give @p dragon_head{display:{Name:'[{""text"":""Flies"",""color"":""yellow""}]',Lore:['[{""text"":""You get a speed of +0.05 when you are equipped on your head.""}]','[{""text"":""You can move more rapidly if you equip yourself for it."",""italic"":true}]','[{""text"":""Not mosquitoes, but Flies."",""italic"":true}]']},AttributeModifiers:[{AttributeName:""generic.movement_speed"",Amount:0.05,Operation:0,UUID:[I;-1201015,29915,174314,-59830],Slot:head,Name:""generic.movement_speed""}]} 1"

I've never known that, so it's surprising...
thanks to you, all of my code worked correctly.
This problem had been bothering me for a while.
Now I am relieved.
Thanks so much, Marsbar!!
 
I've never known that, so it's surprising...
thanks to you, all of my code worked correctly.
This problem had been bothering me for a while.
Now I am relieved.
Thanks so much, Marsbar!!
Ofc. Did you know you can do the same trick with % and #

If you want either ",# or % in a string, it needs to be double.
 
Ofc. Did you know you can do the same trick with % and #

If you want either ",# or % in a string, it needs to be double.
Oh, I didn't know also that.
When I need to use the trick, I'll try to use it...!
 
Status
Not open for further replies.