HelpChat / DeluxeMenus

DeluxeMenus but open source!?
https://wiki.helpch.at/clips-plugins/deluxemenus
MIT License
81 stars 42 forks source link

Give syntax player_head with a custom name 1.20.5. #124

Closed OperVaite closed 3 months ago

OperVaite commented 3 months ago

After update 1.20.5, the syntax of the Give command has changed. I'm trying to give the player a head with a custom name, via [console] minecraft:give, it gives the error "expected , but found '['".

Full line: - '[console] minecraft:give %player_name% minecraft:player_head[custom_name='["",{"text":"Дубовое бревно","italic":false}]',profile={properties:[{value:"eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvM2I2NTFkMzVkMTlhNzBmMzc3MmVhNTU5NTZmMjIyNjRhMWZiMmFlZmY2OTU5YjRlMTQwNjVhOTU2OTYyOTcxYyJ9fX0=",name:textures}]}] 1'

1 2

BlitzOffline commented 3 months ago

The issue is the fact that your strings contain quotes. This is a YAML issue rather than a DeluxeMenus one. However, to fix it, you can escape quotes in YAML like so:

 - '[console] minecraft:give %player_name% minecraft:player_head[custom_name=''["",{"text":"Дубовое бревно","italic":false}]'',profile={properties:[{value:"eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvM2I2NTFkMzVkMTlhNzBmMzc3MmVhNTU5NTZmMjIyNjRhMWZiMmFlZmY2OTU5YjRlMTQwNjVhOTU2OTYyOTcxYyJ9fX0=",name:textures}]}] 1'