enchantの値を構文で完結させたい?

pr環境1.20.6です 現在 ツールにsharpnessのエンチャントを変数分つける場合 evaluateを使って数値を指定してるのですが 構文で数値を指定したいです 現在 evaluate "add sharpness %{_n}% to enchantments of player's tool" 理想 add sharpness {_n} to enchantments of player's tool (このままだとエラーが出てしまう)
8 Replies
tanokun
tanokun4w ago
エラーの内容がないとできないよう たぶんnumber何とかエラーな気がするけど
1oc3
1oc3OP4w ago
soredesu スクショを取ってきます
tanokun
tanokun4w ago
add sharpness {_n} parsed as integer to enchantments of player's tool で行けんじゃね?
1oc3
1oc3OP4w ago
No description
1oc3
1oc3OP4w ago
エラー両方同じです
tanokun
tanokun4w ago
skUnity Forums
Solved - having problem giving random enchantment level
set {_sharpness} to random integer between 0 and 5 set {_enc1} to "sharpness" parsed as enchantment give player wooden sword with enchantment "%{_enc1}% %{_sharpness}%" parsed as enchantment type this won't work help me please error Line 13: (random weapon.sk) [11:56:01] [Server thread/INFO]...
tanokun
tanokun4w ago
set {_enchant} to "sharpness"
set {_level} to random integer between 0 and 5
set {_item} to sword
enchant {_item} with "%{_enchant}% %{_level}%" parsed as enchantment type
give player {_item}
set {_enchant} to "sharpness"
set {_level} to random integer between 0 and 5
set {_item} to sword
enchant {_item} with "%{_enchant}% %{_level}%" parsed as enchantment type
give player {_item}
1oc3
1oc3OP4w ago
ありがとうございます

Did you find this page helpful?