set name of player's tool to {_name}が動かない

on tool change:
wait 1 tick
if player is op:
stop if player is not sneaking
type of player's tool is dye
getAmmoID(player's tool) is set
set {_newName} to uncolored getAmmoID(player's tool)
set {_cartridge} to getAmmoCartridge(player's tool)
replace all {_cartridge} in {_newName} with "§e§l§n%{_cartridge}%§r§f"
replace all "&" in {_newName} with "§"
name of player's tool is not {_newName}
send "setAmmoName:%{_newName}%"
set name of player's tool to "%{_newName}%"
on tool change:
wait 1 tick
if player is op:
stop if player is not sneaking
type of player's tool is dye
getAmmoID(player's tool) is set
set {_newName} to uncolored getAmmoID(player's tool)
set {_cartridge} to getAmmoCartridge(player's tool)
replace all {_cartridge} in {_newName} with "§e§l§n%{_cartridge}%§r§f"
replace all "&" in {_newName} with "§"
name of player's tool is not {_newName}
send "setAmmoName:%{_newName}%"
set name of player's tool to "%{_newName}%"
特定のアイテムを持ち換えたときに、 名前にカラコを追加してくれるコードなんですけど なぜかset name of player's tool to {_newName}が動きません 実際に動かすと画像のように{_newName}は生成されています set name of player's tool to "%{_newName}%" のように文字列にしてもダメでした 一方で、文字列+変数の形にしたり 無関係な文字列なら問題なくうごいていました set name of player's tool to "test %{_newName}%" set name of player's tool to "-" 訳が分からないので、どなたか知恵を貸してください
No description
No description
No description
20 Replies
unnnnnnnnnnn
unnnnnnnnnnn7mo ago
name of player's toolがsetできないとか ああ無関係な文字列なら動くのか
Tsukineko(月雲)
name of player's tool is not {_newName}
set {_tool} to player's tool
send "%{_tool}%"
set name of {_tool} to {_newName}
set player's tool to {_tool}
name of player's tool is not {_newName}
set {_tool} to player's tool
send "%{_tool}%"
set name of {_tool} to {_newName}
set player's tool to {_tool}
これもだめでした
unnnnnnnnnnn
unnnnnnnnnnn7mo ago
set name of player's tool to {_newname}だとどうなるの? 色の情報が落ちてるだけな気がして あるいはcolored "%{_newname}%"? でもこれで同じようなことやってんのか
Tsukineko(月雲)
こっちむりした だめでした…
unnnnnnnnnnn
unnnnnnnnnnn7mo ago
set name of player's tool to "a" set name of player's tool to {_newname} だとどうなる?
Tsukineko(月雲)
だめでした… カラコがない状態の文字列が一致したらだめなのかな と思って試したんすけど
unnnnnnnnnnn
unnnnnnnnnnn7mo ago
なんだろ だめっていうのは、アイテム名がaになるだけってこと?
Tsukineko(月雲)
カラコがない{_newName}になりました ※変数の中身になりました
unnnnnnnnnnn
unnnnnnnnnnn7mo ago
set name of player's tool to colored {_newname} は
Tsukineko(月雲)
on tool change:
wait 1 tick
if player is op:
stop if player is not sneaking
type of player's tool is dye
getAmmoID(player's tool) is set
set {_newName} to uncolored getAmmoID(player's tool)
set {_cartridge} to getAmmoCartridge(player's tool)
replace all {_cartridge} in {_newName} with "§e§l§n%{_cartridge}%§r§f"
replace all "&" in {_newName} with "§"
name of player's tool is not {_newName}
set {_tool} to player's tool
set name of player's tool to "&3e"
set name of player's tool to colored {_newName}
on tool change:
wait 1 tick
if player is op:
stop if player is not sneaking
type of player's tool is dye
getAmmoID(player's tool) is set
set {_newName} to uncolored getAmmoID(player's tool)
set {_cartridge} to getAmmoCartridge(player's tool)
replace all {_cartridge} in {_newName} with "§e§l§n%{_cartridge}%§r§f"
replace all "&" in {_newName} with "§"
name of player's tool is not {_newName}
set {_tool} to player's tool
set name of player's tool to "&3e"
set name of player's tool to colored {_newName}
いまこんなかんじっす…
unnnnnnnnnnn
unnnnnnnnnnn7mo ago
set {_empty} to "" set name of player's tool to "%{_empty}%%{_newName}%" 変数+変数の場合どうなるのかなって
Tsukineko(月雲)
ダメっぽいですね。。。カラコのない見た目になります ""を"-"にしたら動きました ??? "-"を付けた状態で名前を変えて "-"を""に置き換えたらいけるんじゃね? と思ってこうしましたが
on tool change:
wait 1 tick
if player is op:
stop if player is not sneaking
type of player's tool is dye
getAmmoID(player's tool) is set
set {_newName} to uncolored getAmmoID(player's tool)
set {_cartridge} to getAmmoCartridge(player's tool)
replace all {_cartridge} in {_newName} with "§e§l§n-%{_cartridge}%§r§f"
name of player's tool is not {_newName}
set name of player's tool to {_newName}
replace all "&" in name of player's tool with "§"
replace all "§§" in name of player's tool with "&"
#replace first "-" in name of player's tool with ""
on tool change:
wait 1 tick
if player is op:
stop if player is not sneaking
type of player's tool is dye
getAmmoID(player's tool) is set
set {_newName} to uncolored getAmmoID(player's tool)
set {_cartridge} to getAmmoCartridge(player's tool)
replace all {_cartridge} in {_newName} with "§e§l§n-%{_cartridge}%§r§f"
name of player's tool is not {_newName}
set name of player's tool to {_newName}
replace all "&" in name of player's tool with "§"
replace all "§§" in name of player's tool with "&"
#replace first "-" in name of player's tool with ""
結果からこが喪失しました
unnnnnnnnnnn
unnnnnnnnnnn7mo ago
command /test:
trigger:
give stone named "ab" to player

on tool change:
wait for 1 tick
set {_n} to uncolored "ab"
set {_c} to "b"
replace all {_c} in {_n} with "§e§l§n%{_c}%§r§f"
replace all "&" in {_n} with "§"
set name of player's tool to {_n}
command /test:
trigger:
give stone named "ab" to player

on tool change:
wait for 1 tick
set {_n} to uncolored "ab"
set {_c} to "b"
replace all {_c} in {_n} with "§e§l§n%{_c}%§r§f"
replace all "&" in {_n} with "§"
set name of player's tool to {_n}
これが動かないってことだよね
Tsukineko(月雲)
command item.rename <string>:
permission: op
trigger:
set name of player's tool to "&r%arg%"
replace all "&" in name of player's tool with "§"
replace all "§§" in name of player's tool with "&"
command item.rename <string>:
permission: op
trigger:
set name of player's tool to "&r%arg%"
replace all "&" in name of player's tool with "§"
replace all "§§" in name of player's tool with "&"
ちなみにこれは動きます あ・・・・ あ・・・・・・・・・・・・ あ"あ"あ"あ"あ"あ"あ"あ"あ"あ"あ"あ"あ"あ"あ"あ"あ"あ"あ"あ"
unnnnnnnnnnn
unnnnnnnnnnn7mo ago
解決した? まだわかってない
Tsukineko(月雲)
自★決
unnnnnnnnnnn
unnnnnnnnnnn7mo ago
§って必要なの?
Tsukineko(月雲)
えー…恥を忍んで申し上げますと 先ほどまで苦戦していた⇧の関数のすぐ下に
# 弾の自動修正
on tool change:
wait 1 tick
if player is op:
player is not sneaking
stop
type of player's tool is dye
set {_ammo} to getAmmoItem(uncoloured name of player's tool)
1 of player's tool is not 1 of {_ammo}
set player's tool to item amount of player's tool of {_ammo}
# 弾の自動修正
on tool change:
wait 1 tick
if player is op:
player is not sneaking
stop
type of player's tool is dye
set {_ammo} to getAmmoItem(uncoloured name of player's tool)
1 of player's tool is not 1 of {_ammo}
set player's tool to item amount of player's tool of {_ammo}
このようなコードがありまして… すごく端的に言うと 『データベースに入ってるアイテムと違うところがあったら勝手に修正してくれるコード』なんですけど…
unnnnnnnnnnn
unnnnnnnnnnn7mo ago
草 わかるわけねえw
Tsukineko(月雲)
わかるはずもなく えー…恥をさらして時間を奪っただけという… まさに自決ものでございます
Want results from more Discord servers?
Add your server
More Posts
棒の持ち方を変える棒の持ち方を上の画像と同じ、クロスボウを持った時と同じようににしたいですプレイヤーを斜め後ろにジャンプさせる方法壁ジャンを作ろうと思っているのですがプレイヤーをジャンプさせる方法がわからなく、教えていただけると幸いですNICKを全員一斉に変更したいがやり方がわからない``` loop all players: set loop-player’s tab list name to “&b&l%player%” ``` といったようなコードを使用してタブのIDアイテムのnbtから数値を取って書き込んだら<none>になる```set {_material} to nbt compound of player's tool set {_value} to tag "value" of {_material} set {変数の数字が減らないタイマーを作りたくてevery secondで毎秒{timer}という変数の数字を1減らすというコードを作ったのですがうまく減ってくれませんでした。 理由がわかる方教えてください エラー等はありません変数が消えない``` on damage: set {attacker.%victim's uuid%.%attacker%} to true on death: loop all players: プレイヤーから、プレイヤーの目線の5ブロック先までダメージ判定を与える方法ビームを作ってみたいのですが、loop entitiesとか使っても上手くできません...毎度の如く、トライアンドエラーで1時間半ぐらい経過して分からなかったので聞きに来ましたif {test::%player%} is set:でクールタイムを作った時に、waitを使うとバグる```on rightclick holding enchanted book: if uncoloured name of player's tool is "test": テレポートしたとき、元の位置からどれだけ離れたかを変数にぶち込む方法お願いします視点を変えずに視点のところへTPする方法多分かなり初歩的な質問だと思うのですが、どうしても分からないのでご教授願います。