MinecraftHeadsなどで気に入った頭を装備したアーマースタンドを頭を傾けた状態でスポーンさせる方法

NBTを使えばいけそうな感じっていうのはわかるんですが、NBTで頭を指定する方法がよくわかってないのでご教示願いたいです。
79 Replies
tanoKun
tanoKun12mo ago
Skript Hub - Documentation
Equip (Effect) - Skript
Equips an entity with some given armor. This will replace any armor that the entity is wearing.
tanoKun
tanoKun12mo ago
これつかってできんかな
yukkina
yukkina12mo ago
%player%'s head あとはnbt add %string% to %entity%'s nbt (skbee)
ふぁたおくん
command /test:
trigger:
spawn an armor stand at player with nbt from "{Small:1b,NoBasePlate:1b,Marker:1b}"
command /test:
trigger:
spawn an armor stand at player with nbt from "{Small:1b,NoBasePlate:1b,Marker:1b}"
SkBee入れてるけどこれが動作しない;
Tsukineko(月雲)
ふつうに set last spawned armor stand's helmet to {_head}
ふぁたおくん
MCIDとかないカスタムヘッドってどう表記すればいいんですかね
Tsukineko(月雲)
MCIDのない… あー… えーっと、これはあくまで俺のやってる手法なんで 最適解じゃないんだけど まずワールドにチェストをおく チェストに 取得したヘッドを入れる チェストを座標指定で取得し そのインベントリを{_inventory}に代入する {_inventory}のスロットを指定してヘッドアイテムを取得し {_head}に代入
ふぁたおくん
ワ...! ちょっと色々調べてみます、、
Tsukineko(月雲)
ちなこれやると ほかのPLで作ったどんなアイテムでもskriptで扱えるようになるで
ふぁたおくん
command /head-test:
trigger:
set {_value} to "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvOGM4YTgyNGI5Yjk0OTM5YWYyZThjZTE4ODQ4MjYxOGRhZDkzM2FlNWRkNjcxYTdiOWFjOTk5ZDNhM2I2MWE1In19fQ=="
set {_skull} to skull from skin with value {_value} signature ""
set data value of {_skull} to 3
give {_skull} to player
command /head-test:
trigger:
set {_value} to "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvOGM4YTgyNGI5Yjk0OTM5YWYyZThjZTE4ODQ4MjYxOGRhZDkzM2FlNWRkNjcxYTdiOWFjOTk5ZDNhM2I2MWE1In19fQ=="
set {_skull} to skull from skin with value {_value} signature ""
set data value of {_skull} to 3
give {_skull} to player
これが正常に動作したんですけど
value {_value} signature ""
value {_value} signature ""
ってところなにしてるんですか? 普通に指定してるだけか
soramame_256
soramame_25612mo ago
skinとかってewogICJ0aW1lc3RhbXAiIDogMTY5MDAwMzk3MTA3OCwKICAicHJvZmlsZUlkIiA6ICI3MWQ5ZTFjMWViOTY0ZjBhYTQwNjRhZjhiNzk1ZDM5MiIsCiAgInByb2ZpbGVOYW1lIiA6ICJzb3JhbWFtZV8yNTYiLAogICJ0ZXh0dXJlcyIgOiB7CiAgICAiU0tJTiIgOiB7CiAgICAgICJ1cmwiIDogImh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZjViYmJiMjZmN2JkNGMwM2IyNzMyNjIyMjMyZGVlNmZhNGY4YTUxYTQ4YjY4NjRkNGY5ZmZjYjlmY2ZlZDE2MCIKICAgIH0sCiAgICAiQ0FQRSIgOiB7CiAgICAgICJ1cmwiIDogImh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZjlhNzY1Mzc2NDc5ODlmOWEwYjZkMDAxZTMyMGRhYzU5MWMzNTllOWU2MWEzMWY0Y2UxMWM4OGYyMDdmMGFkNCIKICAgIH0KICB9Cn0=みたいなデータになっててそれがvalue, signatureは一応署名だけど存在意義がよく分かってない utf-8でbase64デコードするとjson出てきてその中にスキンの画像url入ってたりする
soramame_256
soramame_25612mo ago
Qiita
マインクラフトのスキンを取得する - Qiita
0. まえがき 以前は以下のようなURLにアクセスすると自動でリダイレクトし、スキンが表示されたのですが、 http://skins.minecraft.net/MinecraftSkins/yuta0801.png いつ...
ふぁたおくん
頭関係ないけど
{a::b::c}
{a::b::c}
ってaファイルの中のbファイルの中のcファイルって言う認識なんだけど、aファイルの中身を全部sendするのってどうしたらいいですか
Tsukineko(月雲)
多分著作権かなんかじゃね set {_list::*} to indexes of {a::*}
yukkina
yukkina12mo ago
aをループしてaの中身(b列)を抽出して、それをまたルーブしてc列を抽出するしかないと思ってる
ふぁたおくん
中身を全部sendするのはこれでできたありがとう
yukkina
yukkina12mo ago
indexes/values ofにして拾うとできるのか? 単に{a::*}だと直下に置かれてるやつしか出せない記憶だったから、、 べんきょうになるぅ
Tsukineko(月雲)
いや、多分普通にkeyのlistが欲しかったんだと思う
ふぁたおくん
functionの()内に書くのってなんですか? 書けるものリストとかあるんですか?
Tsukineko(月雲)
例えば function tpPlayerToLobby() ってなまえで、playerを指定の場所にtpする関数が書きたいとして
function tpPlayerToLobby():
set {_loc} to location(0,0,0)
teleport player to {_loc}
function tpPlayerToLobby():
set {_loc} to location(0,0,0)
teleport player to {_loc}
でもfunctionのなかにplayerなんていないじゃん on joinとかon right click じゃあるまいし
ふぁたおくん
はい
Tsukineko(月雲)
そういうときに、playerとかオブジェクトをfunctionに渡す方法がある
function tpPlayerToLobby(p: player):
set {_loc} to location(0,0,0)
teleport {_p}to {_loc}
on join:
tpPlayerToLobby(player)
function tpPlayerToLobby(p: player):
set {_loc} to location(0,0,0)
teleport {_p}to {_loc}
on join:
tpPlayerToLobby(player)
()のなかに 変数名: type ってしてあげると 関数使うときに()の中に対応するオブジェクト入れてあげることで 関数実行時に{_変数名} で使えるようになる
ふぁたおくん
function tp(v: victim):
set {_loc} to location(0,0,0)
teleport {_v} to {_loc}
on damage:
tp(victim)
function tp(v: victim):
set {_loc} to location(0,0,0)
teleport {_v} to {_loc}
on damage:
tp(victim)
ってできますか
mirageeeeeeeeeeeeeeeeeeeeeeeeeee
victimはプレイヤーの一種だからplayerって書くんやで
ふぁたおくん
on damage of an armor stand:の場合は?
mirageeeeeeeeeeeeeeeeeeeeeeeeeee
あ~なるほどね その場合は
function tp(v: entity):
set {_loc} to location(0,0,0)
teleport {_v} to {_loc}
function tp(v: entity):
set {_loc} to location(0,0,0)
teleport {_v} to {_loc}
ふぁたおくん
entityでいけるんか ありがとう
ふぁたおくん
on damage of an armor stand:
cancel event
if attacker's tool is wooden axe:
if victim's helmet is not air:
catch(entity, player, "%name of entity's helmet%")
on damage of an armor stand:
cancel event
if attacker's tool is wooden axe:
if victim's helmet is not air:
catch(entity, player, "%name of entity's helmet%")
No description
Tsukineko(月雲)
関数を出せ関数を
ふぁたおくん
したのはいいけど
Tsukineko(月雲)
たぶんplayerじゃなくてattackerだと思うおいらです
ふぁたおくん
はう
Tsukineko(月雲)
あと該当関数krkr
ふぁたおくん
function catch(v: entity, a: attacker, t: text):
teleport the {_v} to location(1,-1000,1, world "world")
set {_skull} to skull from skin with value "%{bugs::%{_t}%::id}%" signature ""
set data value of {_skull} to 3
set name of {_skull} to "%{bugs::%{_t}%::name}%"
give {_skull} to {_p}
function catch(v: entity, a: attacker, t: text):
teleport the {_v} to location(1,-1000,1, world "world")
set {_skull} to skull from skin with value "%{bugs::%{_t}%::id}%" signature ""
set data value of {_skull} to 3
set name of {_skull} to "%{bugs::%{_t}%::name}%"
give {_skull} to {_p}
tanoKun
tanoKun12mo ago
そもそも {_p} 存在してないよ attacker じゃなくて player でいいと思う
chinatukano
chinatukano12mo ago
v: entity みたいになっていたら vが一時変数でentityが型だよ
ふぁたおくん
on damage of an armor stand:
cancel event
if attacker's tool is wooden axe:
if victim's helmet is not air:
catch(entity, player, "%name of entity's helmet%")

function catch(v: entity, a: player, t: text):
teleport the {_v} to location(1,-1000,1, world "world")
set {_skull} to skull from skin with value "%{bugs::%{_t}%::id}%" signature ""
set data value of {_skull} to 3
set name of {_skull} to "%{bugs::%{_t}%::name}%"
give {_skull} to {_a}
on damage of an armor stand:
cancel event
if attacker's tool is wooden axe:
if victim's helmet is not air:
catch(entity, player, "%name of entity's helmet%")

function catch(v: entity, a: player, t: text):
teleport the {_v} to location(1,-1000,1, world "world")
set {_skull} to skull from skin with value "%{bugs::%{_t}%::id}%" signature ""
set data value of {_skull} to 3
set name of {_skull} to "%{bugs::%{_t}%::name}%"
give {_skull} to {_a}
No description
ふぁたおくん
こうなりました さっきattacker使ってもuse 'attacker'って言われたのこわい
Yeahn
Yeahn12mo ago
catch(entity, player, name of victim's helmet) じゃないの..?
ふぁたおくん
%いらないですか? してみる
Yeahn
Yeahn12mo ago
エンティティのヘルメットの名前ってもともとstring型じゃ entityってそれを受けたエンティティなのか受けさせたエンティティか混同しそうだからvictimかattackerに絞ったほうがよさそうだけど プレイヤーもエンティティに入るからね
chinatukano
chinatukano12mo ago
on damage of an armor stand:
cancel event
if attacker's tool is wooden axe:
if victim's helmet is not air:
catch(victim, attacker, name of victim's helmet)

function catch(v: entity, a: player, t: text):
teleport {_v} to location(1,-1000,1)
set {_skull} to skull from skin with value "%{bugs::%{_t}%::id}%" signature ""
set data value of {_skull} to 3
set name of {_skull} to "%{bugs::%{_t}%::name}%"
give {_skull} to {_a}
on damage of an armor stand:
cancel event
if attacker's tool is wooden axe:
if victim's helmet is not air:
catch(victim, attacker, name of victim's helmet)

function catch(v: entity, a: player, t: text):
teleport {_v} to location(1,-1000,1)
set {_skull} to skull from skin with value "%{bugs::%{_t}%::id}%" signature ""
set data value of {_skull} to 3
set name of {_skull} to "%{bugs::%{_t}%::name}%"
give {_skull} to {_a}
Tsukineko(月雲)
ってかplayerをaって命名するのすげー違和感ある
chinatukano
chinatukano12mo ago
catch(victim, attacker, name of victim's helmet)
Yeahn
Yeahn12mo ago
pだろっていうのはある(
chinatukano
chinatukano12mo ago
vも違和感
Yeahn
Yeahn12mo ago
entityの受け渡しってそもそもできるんか問題はあるけどね
ふぁたおくん
victimとattackerだからわかりやすいかなとおもった もらったコードにしてみた結果
Yeahn
Yeahn12mo ago
entityを victimに
chinatukano
chinatukano12mo ago
entityをvictimにしよう
Yeahn
Yeahn12mo ago
変更してください
chinatukano
chinatukano12mo ago
catch(victim, attacker, name of victim's helmet)
Yeahn
Yeahn12mo ago
最悪metadata渡して all entities where [metadata value "test" of input is true] 的なことしてもいいと思うけどね
ふぁたおくん
えらーきえた
Yeahn
Yeahn12mo ago
うごく?
Tsukineko(月雲)
まあその意志はわかるんだけど function内では基本的に大本となるtypeを使うよう心掛けたほうがいい ※attacker、victim -> entity、player -> {_e} {_p}とか
chinatukano
chinatukano12mo ago
attacker victimはon damageとかon deathでしか使えないからね
Yeahn
Yeahn12mo ago
だからと言ってoffline playerをoにされるのも少し違和感あるけどねw
ふぁたおくん
うごきました~ ありがとうございます!
Yeahn
Yeahn12mo ago
Marked as solved
ふぁたおくん
a::b::c
a::b::c
aファイルの中にファイルがいくつかあって、そのいくつかのファイルの中にもいくつかのファイルが入ってるんだけど ぜーんぶsendするにはどうしたらいいですか
tanoKun
tanoKun12mo ago
loop {a::*}
ふぁたおくん
loopか あざす
tanoKun
tanoKun12mo ago
全部回るかはわからんけど そのあと関数作って全部回るようにすればいい
yukkina
yukkina12mo ago
回んない記憶
ふぁたおくん
いろいろためしたけどわかんなかった
soramame_256
soramame_25612mo ago
a::*で回るのはa::bだけ a::bがリストになってるからloop-valueを更に回すとloop-value-2にcが入る
yukkina
yukkina12mo ago
その回し方でいいんだ!? やば もっと早く知りたかった index拾ってたわ
soramame_256
soramame_25612mo ago
多分index拾わないと無理かも 正直最近skript触ってないからごっちゃになってる
Tsukineko(月雲)
indexes必要っすね
ふぁたおくん
command /send:
permission: *
trigger:
set {_s::*} to indexes of {bugspawn::*}
loop {_s::*}:
loop {_s::%loop-index%::*}:
send "%loop-index-2%"
command /send:
permission: *
trigger:
set {_s::*} to indexes of {bugspawn::*}
loop {_s::*}:
loop {_s::%loop-index%::*}:
send "%loop-index-2%"
結局どういうことだってばよ
mirageeeeeeeeeeeeeeeeeeeeeeeeeee
再帰処理が必要だす このコードなら、 ・下から2行目のloop-indexをloop-valueに変える ・1番下のloop-index-2をloop-indexに変える てか下から2行目のloopする変数も違うか
ふぁたおくん
ちなみに
{bugspawn::%loo-value%::*}
{bugspawn::%loo-value%::*}
の中身が座標なんですけど話違いますか 121212が一個ずつ出力された
何か
何か12mo ago
loop {bugspawn::*}:
loop {bugspawn::%loop-index%::*}:
send "%loop-index2% %loop-value-2%"
loop {bugspawn::*}:
loop {bugspawn::%loop-index%::*}:
send "%loop-index2% %loop-value-2%"
function indexes(s: string) :: strings:
add {_s} to {_results::*}
loop {%{_s}%::*}:
add indexes("%{_s}%::%loop-index%") to {_results::*}
return {_results::*}

command /send:
trigger:
loop indexes("bugspawn"):
send "%loop-value%"
function indexes(s: string) :: strings:
add {_s} to {_results::*}
loop {%{_s}%::*}:
add indexes("%{_s}%::%loop-index%") to {_results::*}
return {_results::*}

command /send:
trigger:
loop indexes("bugspawn"):
send "%loop-value%"
再起処理ですべて取る場合
ふぁたおくん
上の奴必要ですか?下のだけ入れてみたらbugspawnとだけsendされました
何か
何か12mo ago
上のは関数
soramame_256
soramame_25612mo ago
再帰できるんだ
Want results from more Discord servers?
Add your server
More Posts
雪玉が貫通されないそもそも``on projectile collide``がキャンセル不可な可能性もありますけどね ``` on projectile collide: if event-entity is armor standの頭だけを発光させたい``` set {_pLoc} to player's head's location spawn armor stand at ({_pLoc} ~ vector(0, -1.125銃skの改善点指摘してほしい初心者のぼくが初めてまともに書いたskということで30発入りSMGを3発ずつ撃ててリロードもできるskです。一応動きます。 変数の使い方とかマジで色々汚いと思いますが「こう書いたらいいよ」とか温かく教vectorの使い方vectorの使い方がぜんっぜんわかりませんsorted LIST のなぞきょどうについて``` set {_sortedKey::*} to indexes of {_areaIDs::*} set {_sortedKey::*} to sorted {アマスタの完全透明化{Invisible:1b,Marker:1b}のnbtをつけたアマスタをプレイヤーに乗せているのですが、スペクテイターにすると見えてしまいます これを見えなくする方法を教えてください PR 1.12GUI内のアイテムをnbtを指定したいGUI内のアイテムをHideFlagsとか指定して 鉄剣とかの利き手に持った時とかの表示を消したい(HideFlags)sk勉強する時に分かりやすいサイトとかおすすめあったら教えてください圧倒的初心者ですおねがいしますWorldGuardと on region enter/leave``` on region leave: if region is "map" parsed as region: set {%player%.escapeAreaID} tブロック破壊対策``` on break: player's gamemode is survival cancel the event on break: player is not op