I use datapacks to create games and the command books are all messed up
What I expected to happen was...:
Command books to execute commands by clicking on the buttons
What actually happened was...:
The command books just display jibberish as you can see in the screenshots provided
Steps to Reproduce:
1. Place down a command block then paste this code item replace entity @a[gamemode=creative] hotbar.8 with written_book{pages:['["",{"text":" Battlefield","bold":true,"color":"dark_blue"},{"text":" v2.31","bold":true,"color":"blue"},{"text":"\\n","color":"reset","bold":true},{"text":"Only click Prime when ALL players are on the server","bold":true,"color":"dark_red"},{"text":"\\n","color":"reset"},{"text":"-------------------","color":"black"},{"text":"\\n","color":"reset"},{"text":" 1. [","color":"black"},{"text":"RESET","color":"red","clickEvent":{"action":"run_command","value":"/execute as @a[gamemode=creative] run function game:reset"},"hoverEvent":{"action":"show_text","contents":"Reset game"}},{"text":"]
n 2. [","color":"black"},{"text":"Install","color":"gold","clickEvent":{"action":"run_command","value":"/execute as @a[gamemode=creative] run function game:install"},"hoverEvent":{"action":"show_text","contents":"Install game"}},{"text":"]
n 3. [","color":"black"},{"text":"Prime","color":"blue","clickEvent":{"action":"run_command","value":"/execute as @a[gamemode=creative] run function game:prep"},"hoverEvent":{"action":"show_text","contents":"Prepare game"}},{"text":"]
n 9. [","color":"black"},{"text":"START","bold":true,"color":"green","clickEvent":{"action":"run_command","value":"/execute as @a[gamemode=creative] run function game:start"},"hoverEvent":{"action":"show_text","contents":"Start game"}},{"text":"]\\n-------------------
n [","color":"black"},{"text":"Relocate?","color":"dark_purple","clickEvent":{"action":"run_command","value":"/execute as @a[gamemode=creative] run function game:relocate"},"hoverEvent":{"action":"show_text","contents":"Change battle area"}},{"text":"]\\n-------------------
n 4. Time of day
n [","color":"black"},{"text":"Day","color":"gold","clickEvent":{"action":"run_command","value":"/execute as @a[gamemode=creative] run function game:arena/day"},"hoverEvent":{"action":"show_text","contents":"Day battle"}},{"text":"] [","color":"black"},{"text":"Night","color":"dark_gray","clickEvent":{"action":"run_command","value":"/execute as @a[gamemode=creative] run function game:arena/night"},"hoverEvent":{"action":"show_text","contents":"Night battle (No mobs)"}},{"text":"]\\n\\n
n ","color":"black"},{"text":"
n ","color":"reset"}]','["",{"text":" 5. Arena Size:
n ["},{"text":"025","color":"dark_red","clickEvent":{"action":"run_command","value":"/execute as @a[gamemode=creative] run function game:arena/25"}},{"text":"][","color":"reset"},{"text":"050","color":"red","clickEvent":{"action":"run_command","value":"/execute as @a[gamemode=creative] run function game:arena/50"}},{"text":"] [","color":"reset"},{"text":"075","color":"gold","clickEvent":{"action":"run_command","value":"/execute as @a[gamemode=creative] run function game:arena/75"}},{"text":"][","color":"reset"},{"text":"100","color":"gray","clickEvent":{"action":"run_command","value":"/execute as @a[gamemode=creative] run function game:arena/100"}},{"text":"]
n [","color":"reset"},{"text":"150","color":"dark_blue","clickEvent":{"action":"run_command","value":"/execute as @a[gamemode=creative] run function game:arena/150"}},{"text":"][","color":"reset"},{"text":"200","color":"blue","clickEvent":{"action":"run_command","value":"/execute as @a[gamemode=creative] run function game:arena/200"}},{"text":"] [","color":"reset"},{"text":"250","color":"green","clickEvent":{"action":"run_command","value":"/execute as @a[gamemode=creative] run function game:arena/250"}},{"text":"][","color":"reset"},{"text":"300","color":"dark_purple","clickEvent":{"action":"run_command","value":"/execute as @a[gamemode=creative] run function game:arena/300"}},{"text":"]\\n-------------------
n 6. Gamemode:
n [","color":"reset"},{"text":"Norm","color":"dark_green","clickEvent":{"action":"run_command","value":"/execute as @a[gamemode=creative] run function game:arena/norm"},"hoverEvent":{"action":"show_text","contents":"Normal: Players will have a melee & a ranged weapon"}},{"text":"] [","color":"reset"},{"text":"CQC","color":"red","clickEvent":{"action":"run_command","value":"/execute as @a[gamemode=creative] run function game:arena/cqc"},"hoverEvent":{"action":"show_text","contents":"CQC: Melee weapon only"}},{"text":"] [","color":"reset"},{"text":"Sniper","color":"blue","clickEvent":{"action":"run_command","value":"/execute as @a[gamemode=creative] run function game:arena/sniper"},"hoverEvent":{"action":"show_text","contents":"Sniper: Ranged weapon only"}},{"text":"]\\n-------------------
n 7. Round length:
n [","color":"reset"},{"text":"10m","color":"red","clickEvent":{"action":"run_command","value":"/execute as @a[gamemode=creative] run function game:timer/10"}},{"text":"][","color":"reset"},{"text":"15m","color":"blue","clickEvent":{"action":"run_command","value":"/execute as @a[gamemode=creative] run function game:timer/15"}},{"text":"] [","color":"reset"},{"text":"20m","color":"green","clickEvent":{"action":"run_command","value":"/execute as @a[gamemode=creative] run function game:timer/20"}},{"text":"][","color":"reset"},{"text":"30m","color":"light_purple","clickEvent":{"action":"run_command","value":"/execute as @a[gamemode=creative] run function game:timer/30"}},{"text":"]\\n-------------------
n 8. Ranged Weapon:\\n","color":"reset"},{"text":"N/A with CQC gamemode","color":"dark_red"},{"text":"
n [","color":"reset"},{"text":"Bow","color":"dark_green","clickEvent":{"action":"run_command","value":"/execute as @a[gamemode=creative] run function game:bow"}},{"text":"] [","color":"reset"},{"text":"Crossbow","color":"dark_blue","clickEvent":{"action":"run_command","value":"/execute as @a[gamemode=creative] run function game:crossbow"}},{"text":"]
n ","color":"reset"}]'],title:"Battlefield Control",author:Cosmoguy}
2. ... Power the command block
3. ... and the book it gives you just displays jibberish in versions 23w40a & 23w41a (Works perfect in 1.20.2)
"
reset" is not a valid colour name. The command only works in 1.20.2 because the game ignores the "color" field entirely if the provided colour doesn't exist. As per the 23w40a changelog, though, invalid entries in thecolorfield are "no longer silently ignored".