プレイヤーの頭を設置する方法
プレイヤーの頭を設置する方法ってありますか?できれば向いている方向も指定できると助かります
set {_player} to "プレイヤーの名前" parsed as offline player
set {_head} to skull of {_player}
spawn an armor stand at player
set last spawned armor stand's helmet to {_head}
add "{Marker:true,NoGravity:1b,Invisible:1b}" to nbt of last spawned armor standcommand /test:
trigger:
set {_skin} to get_skin_data("9dff58ee-4d9c-45f2-aa23-6602760a67bf")
set {_skin} to get_skin_data(player)
set nbt-block at player to minecraft:player_head with nbt of "{SkullOwner:{Id:%uuid int array as string%,Properties:{textures:[{Value:""%{_skin}%""}]}}}"
import:
javax.net.ssl.HttpsURLConnection
java.io.BufferedInputStream
java.net.URL
java.lang.String
com.google.gson.Gson
com.google.gson.JsonObject
function get_skin_data(p: object) :: object:
set {_uuid} to uuid of {_p}
if {_uuid} is not set:
set {_uuid} to {_p}
replace "-" with "" in {_uuid}
set {_res} to get_json("https://sessionserver.mojang.com/session/minecraft/profile/%{_uuid}%")
return {_res}.get("properties").getAsJsonArray().get(0).getAsJsonObject().get("value").getAsString()
function get_json(url: string) :: object:
set {_con} to new URL({_url}).openConnection()
set {_text} to new String(new BufferedInputStream({_con}.getInputStream()).readAllBytes())
set {_json} to new Gson().fromJson({_text}, JsonObject.class)
return {_json}