function url(s: string) :: string: replace all "ยง" in {_s} with "&" return {_s} command /head [] []: trigger: if arg-1 is "Blocks", "food", "electronics", "characters", "flags", "letters", "youtubers", "halloween" or "christmas": set {_url} to url("https://headdb.com/api/category/%arg-1%") send a request to {_url} with the headers "User-Agent: IDK" set {_body} to the last received http web response's body copy json {_body} to {_SK::*} open chest with 6 rows named "&6Head Data Base - %arg-1%" to player set {_s} to 0 set {_p} to 1 loop {_SK::*}: set {_nbt} to {_SK::%loop-index%::command} replace every "/give @p skull 1 3 " with "" in {_nbt} replace all "Skull from HeadDB.com" with "&8%{_SK::%loop-index-1%::uuid}%" in {_nbt} add {_nbt} to {_Page::%{_p}%::*} add 1 to {_s} if {_s} is ((9*6)-1): add 1 to {_p} set {_s} to 0 if arg-2 is set: set {_p} to arg-2 else: set {_p} to 1 set {_s} to 0 loop {_Page::%{_p}%::*}: set slot {_s} of player's current inventory to player's skull with custom nbt "%loop-value%" add 1 to {_s} add 1 to {_p} if {_Page::%{_p}%::*} is set: set slot {_s} of player's current inventory to book named "NEXT PAGE!" with lore "&8%{_p}%||&8%arg-1%" else: open chest with 1 rows named "&6Head Data Base" to player set {_s::*} to "Blocks", "Food", "Electronics", "Characters", "Flags", "Letters", "Youtubers", "Halloween" and "Christmas" loop 9 times: set slot loop-number -1 of player's current inventory to book named "%{_s::%loop-number%}%" on inventory click: if name of player's current inventory is "&6Head Data Base": cancel event if clicked item is book: make player execute command "/head %uncolored name of clicked item%" close player's inventory else if name of player's current inventory contains "&6Head Data Base - ": if clicked item is book: cancel event close player's inventory set {_s::*} to uncolored lore of clicked item split at "||" make player execute command "/head %{_s::2}% %{_s::1}%"