Closed qsef1256 closed 1 year ago
I just noticed that the yaml is not saved. I added save yaml {@file}
and it worked fine. It would be nice if there was a separate warning, but for now it's my fault, so I'll close the issue.
The next release(which i should release soon) will catch this error and several others and give a bit more detail as to what went wrong that way you arent left wondering wtf.. :D
Code:
options:
file: "plugins/Skript/scripts/test.yml"
command /yaml [<text>] [<text>]:
trigger:
load yaml {@file} as {@file}
arg 2 is set
set {_data} to arg 2
if arg 1 is "add":
add {_data} to yaml list "user" from {@file}
if arg 1 is "remove":
remove {_data} from yaml list "user" from {@file}
save yaml {@file}
Reproduce:
/yaml add 1
/yaml remove 1
Version: Server Version: 3243-Spigot-6c1c1b2-d3cc412 (MC: 1.17.1) Skript Version: 2.6-beta3 skript-yaml Version: v1.4
The script I was originally trying to fix still doesn't work. While checking around for why my scripts is not working, I found a problem. When using skript-yaml with command arguments and a yaml list, skript-yaml does not remove the values from the yaml list.
When I put "a" instead of arg 2 in {_data} it worked fine. There were no console errors when running this script, but there were several internal errors when modifying the script to figure out this bug. I'm guessing it's probably the same error as the one above.
But this problem is a bit different from my script problem, and I'm still having problems. I'll post an issue when I figure out what was the problem with my script.
if you could contact me on discord i have a more updated version id like you to try and we can go from there
Sashie#2683
Skript probably tries to subtract the value and it won't remove the number
Description: Can't remove value from yaml list.
Code:
Expected Result: The value should be removed from the list.
Console Error:
Version: Server Version: 3243-Spigot-6c1c1b2-d3cc412 (MC: 1.17.1) Skript Version: 2.6-beta3 skript-yaml Version: v1.4