プレイヤーの頭を設置する方法

プレイヤーの頭を設置する方法ってありますか?できれば向いている方向も指定できると助かります
5 Replies
makaronipizaa
makaronipizaa4mo ago
最近よくここ使ってて申し訳ないんですが、ちゃんと調べてから訳分からんから来てるので許して(泣)
Tsukineko(月雲)
横失 俺もログ漁ったけど アイテムとしてのヘッドはあっても ブロックとしての設置はいまいち分からなかった 設置しようとしたら、そもそも設置されないか、スケルトンヘッドになって困ってる コマンドで取得したヘッドを適当な場所に設置して locationでそのブロック指定して 直接別の場所に設置してもスケルトンヘッドになる もし良かったら誰か解決法わかる人教えて欲しい
makaronipizaa
makaronipizaa4mo ago
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 stand
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 stand
私はこんな感じでやりました 設置も作る途中でできた気がする 作りたいもの上当たり判定要らなかったので防具立てに着せましたけど 普通にset blockでできたはず
何か
何か4mo ago
自分が何をしたくて、そのために何をして、その結果がどうだったのか その結果に不満なら何が不満なのか あと添えるべき情報として https://discord.com/channels/545926404785569793/928863480570851368 にものせてある通りサーバーの環境とかは最低限入れるべき 調べたというからにはそれを証明したほうがいい どっかのエスパー案件の人は感情的になって安易にbadつけてますが とても大事なことなので忘れないようにしましょう これはスレ主の質問じゃなくてtsukinekoの質問に答えるけど
command /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}
command /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}
playerの頭をブロックとして扱う場合は minecraft:player_headとか player skullなんちゃらっていうエイリアスがskullとして登録されてるから これにスキンの情報を持ってるSkullOwnerのtexturesっていうnbtを設定してやれば プレイヤーの頭がおける texturesに置かれてるのはbase64エンコードされたjsonデータで、フォーマットはmcの公式apiの uuid to skinと同じだから それを直接設定してやればいい そして頭の回転はblock dataとして扱われてるから set block data of %block% to "" parsed as block data とか そういうので設定できる
Want results from more Discord servers?
Add your server
More Posts
パーティクルをプレイヤーを中心とした円状に表示させる方法調べてもでてこない...............エンチャント本のエンチャント名とレベルを個別に取得したいエンチャント本のエンチャント名とレベルを個別にリスト型で取得しようとしたのですがサイト等を探しても見当たらなかったので方法があるなら教えていただきたいです string型に変換しsplitを使用して強トップのみ表示するランキングを作りたい{count.%player'suuid%} という変数に一番数字の入っているプレイヤーのIDと数字をメッセージとして送信したいのですが、どうしたらプレイヤーのIDと数字を同時にメッセージとして送信でアイテム入りリストをsortアイテムが入った`{_items::*}`において `set {_items::*} to sorted {_items::*}` してみたのですが、全く変化がありませんでした sk hub曰くpla殴ると4回追加攻撃が入るskみなさんならどう書くのかと思いました 詳細 ダメージを与えた時、30tickごとに10ダメージが入る。 例 1(素手)→10→10→10→10 発動中、もう一度同じ敵にダメージを与えてもダメージの重複チェストブロックに名前を付けられない``` set {_block} to block at {_loc} set {_inv} to {_block}'s inventory SkRageのEffClientSideEquipmentの使い方Skrage v2.4.5でEffClientSideEquipmentを使う方法を教えて下さい make player head {_p}'s helmet for all players これアイテムが入っているチェストをコピーできない{a}はアイテムが入っているチェストです /random2で{a}のチェストをコピーしようとしてますが、ブロックのみが置かれて、アイテムの中身が入っていません アイテムが入った状態のチェストをそのまま自作Ender Container、なぜかページが勝手に閉じるマルチ(max9)ページのエンダーチェストを作ったのですが なぜか開いてるページが勝手に閉じてしまいます。 closeなどを使っているわけでもないので、原因がわからず困ってます。 ほかのinvento緊急事態発生!!!!!<:AirusFuck:720978725067554848> <:AirusFuck:720978725067554848> 😂 😂 😂 😂 <:AirusFuck:72097872506