エンチャント本のエンチャント名とレベルを個別に取得したい

エンチャント本のエンチャント名とレベルを個別にリスト型で取得しようとしたのですがサイト等を探しても見当たらなかったので方法があるなら教えていただきたいです string型に変換しsplitを使用して強引に分解できるかも試しましたがそもそもエンチャント名ごとの空白の数が違ったのでできませんでした 数字などの値を検知して分解できるのかもできれば教えていただきたいです
command /getench:
trigger:
loop enchantments of player's tool:
set {_level} to enchantment level of loop-value
set {_enchant} to enchantment of loop-value
send "%{_enchant}% %{_level}%" to player
set {_ench::*} to stored enchants of player's tool
set {_n} to 1
loop {_ench::*}:
send "%{_ench::%{_n}%}%" to player
add 1 to {_n}
command /getench:
trigger:
loop enchantments of player's tool:
set {_level} to enchantment level of loop-value
set {_enchant} to enchantment of loop-value
send "%{_enchant}% %{_level}%" to player
set {_ench::*} to stored enchants of player's tool
set {_n} to 1
loop {_ench::*}:
send "%{_ench::%{_n}%}%" to player
add 1 to {_n}
No description
Solution:
行けました おそらくloop enchantments of player's tool:のループのところでloop stored enchants of player's tool:に変えないといけないのだと思われます...
Jump to solution
18 Replies
___
___5mo ago
Skript Hub - Documentation
Enchantment Level (Expression) - Skript
The level of a particular enchantment on an item.
こすも
こすも5mo ago
色々試した時stored enchantsのほうでしかエンチャントが取れなかったんですよね
___
___5mo ago
試したこと 試して得られた結果 エラーがあるか 書いてください 情報が少なすぎます
こすも
こすも5mo ago
わかりました このエンチャント本を持った状態で試したこと書いてきます
No description
こすも
こすも5mo ago
1 stored enchants 後のコードを消した場合
command /getench:
trigger:
loop enchantments of player's tool:
set {_level} to enchantment level of loop-value
set {_enchant} to enchantment of loop-value
send "%{_enchant}% %{_level}%" to player
command /getench:
trigger:
loop enchantments of player's tool:
set {_level} to enchantment level of loop-value
set {_enchant} to enchantment of loop-value
send "%{_enchant}% %{_level}%" to player
エラーはなし send "%{_enchant}% %{_level}%" to playerによるメッセージは送られませんでした
こすも
こすも5mo ago
2 loop enchantments of player's tool:のループの中身のコードを消した場合
command /getench:
trigger:
set {_ench::*} to stored enchants of player's tool
set {_n} to 1
loop {_ench::*}:
send "%{_ench::%{_n}%}%" to player
add 1 to {_n}
command /getench:
trigger:
set {_ench::*} to stored enchants of player's tool
set {_n} to 1
loop {_ench::*}:
send "%{_ench::%{_n}%}%" to player
add 1 to {_n}
エラーはなし エンチャント名 レベルのかたまりで改行しながらメッセージが送られました
No description
こすも
こすも5mo ago
3 そのまま 2と同じようにメッセージが送られました エラーはありません
No description
___
___5mo ago
enchantment level of loop-value
enchantment of loop-value
enchantment level of loop-value
enchantment of loop-value
動きますけど
No description
こすも
こすも5mo ago
一応そちらの入れてるアドオン確認したいのですが平気ですか
___
___5mo ago
環境は全て合わせてます ただSkStuffとSkBeeが競合する可能性があるのでSkStuff抜いたほうがいいと思います
こすも
こすも5mo ago
もう1回やってみます 動きませんね... 何か間違ったところがあったんですかね
___
___5mo ago
command /t:
trigger:
set {_item} to enchanted book
add depth strider 3 to stored enchants of {_item}
add efficiency 4 to stored enchants of {_item}
add respiration 3 to stored enchants of {_item}
add smite 5 to stored enchants of {_item}
loop stored enchants of {_item}:
send "%enchantment level of loop-value%" to console
send "%enchantment of loop-value%" to console
command /t:
trigger:
set {_item} to enchanted book
add depth strider 3 to stored enchants of {_item}
add efficiency 4 to stored enchants of {_item}
add respiration 3 to stored enchants of {_item}
add smite 5 to stored enchants of {_item}
loop stored enchants of {_item}:
send "%enchantment level of loop-value%" to console
send "%enchantment of loop-value%" to console
これ実行してみてください
こすも
こすも5mo ago
できました
No description
___
___5mo ago
tool of player が enchanted book でないか、構文に渡された時の型の問題じゃないですか send "%tool of player%" で enchanted book であることを確認する または
set {_item} to tool of player
set {_ench::*} to stored enchants of {_item}
set {_item} to tool of player
set {_ench::*} to stored enchants of {_item}
に書き換えてみる
Solution
こすも
こすも5mo ago
行けました おそらくloop enchantments of player's tool:のループのところでloop stored enchants of player's tool:に変えないといけないのだと思われます
こすも
こすも5mo ago
ありがとうございました
___
___5mo ago
2個目のコードで動かないのかと思ってた
こすも
こすも5mo ago
動いた後にloop stored enchants of player's tool:で型の問題かを確認しました 言い忘れてました すみません 了解です
Want results from more Discord servers?
Add your server
More Posts
トップのみ表示するランキングを作りたい{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ネームタグ死亡これを修正したらネームタグ死にました\ https://discord.com/channels/545926404785569793/1196759070661689417別の人の役職が表示されてしまう``` every 1 seconds: loop all players: delete loop-player's sidebar if {tct::ing