1つのアイテムにAttributeを複数つけたい

function make_attr(attr: string, name: string, slot: string, operation: number, amount: number) :: string:
set {_least} to random integer between 0 and 1000000000
set {_most} to random integer between 0 and 1000000000
return "{AttributeName:""%{_attr}%"",Name:""%{_name}%"",Slot:""%{_slot}%"",Operation:%{_operation}%,Amount:%{_amount}%D,UUIDLeast:%{_least}%L,UUIDMost:%{_most}%L}"

set {_attribute} to make_attr("generic.なんとか","attr", "%{_slot}%", {_operation}, {_amount})
add "{AttributeModifiers:[%{_attribute}%]}" to nbt of player's tool
function make_attr(attr: string, name: string, slot: string, operation: number, amount: number) :: string:
set {_least} to random integer between 0 and 1000000000
set {_most} to random integer between 0 and 1000000000
return "{AttributeName:""%{_attr}%"",Name:""%{_name}%"",Slot:""%{_slot}%"",Operation:%{_operation}%,Amount:%{_amount}%D,UUIDLeast:%{_least}%L,UUIDMost:%{_most}%L}"

set {_attribute} to make_attr("generic.なんとか","attr", "%{_slot}%", {_operation}, {_amount})
add "{AttributeModifiers:[%{_attribute}%]}" to nbt of player's tool
上記のコードで、手に持っているアイテムにAttributeを付与しているのですが 例えば、 generic.attackDamageを付与したあと、同じアイテムでgeneric.movementSpeedを付与すると、attackDamageがmovementSpeedに上書きされてしまい、結果Attributeが一個しかつかなくなってしまいます。 どうにかしてAttributeを複数付与させたいです。 (上の例で言うならattackDamageとmovementSpeedの2つを付与させたい) PR 1.12.2 Skript 2.5.3 SkBee v1.10.2
Solution:
自己解決しました
Jump to solution
1 Reply
Solution
gladiolus8789
gladiolus87899mo ago
自己解決しました
Want results from more Discord servers?
Add your server