last shot entity がバグってる

on leftclick holding bow:
set {_x} to x-coordinate of player
set {_y} to y-coordinate of player + 1.6
set {_z} to z-coordinate of player
set {_world} to world of player
set {_yaw} to player's yaw
set {_pitch} to player's pitch
shoot arrow from player and location({_x}, {_y}, {_z}, {_world}, {_yaw}, {_pitch}) at speed 2.8
set {arrow::%last shot entity's uuid%} to 300

on damage:
attacker is player
victim is not player
projectile is set

set damage to {arrow::%projectile's uuid%}
on leftclick holding bow:
set {_x} to x-coordinate of player
set {_y} to y-coordinate of player + 1.6
set {_z} to z-coordinate of player
set {_world} to world of player
set {_yaw} to player's yaw
set {_pitch} to player's pitch
shoot arrow from player and location({_x}, {_y}, {_z}, {_world}, {_yaw}, {_pitch}) at speed 2.8
set {arrow::%last shot entity's uuid%} to 300

on damage:
attacker is player
victim is not player
projectile is set

set damage to {arrow::%projectile's uuid%}
とすると、矢が当たった敵に300ダメージが入らないです。 broadcast でprojectileとlast shot entityのuuidをみたらどっちも違うuuidでした。
6 Replies
月猫ch
月猫ch16mo ago
uuidを揃える方法が思いつかない&無駄に変数が増え続けそう なので 素直にmetadeta使ってもいいかも metadata "key" of entity (あと、last shot arrowとかsnowballとかにしてもだめ?)
るび
るびOP16mo ago
last shot entityとprojectileが全くの別のエンティティが出てくるんですよね last shot arrowでも無理でした
unnnnnnnnnnn
unnnnnnnnnnn16mo ago
wait for 1 tickしても同じ?
るび
るびOP16mo ago
同じでした
on leftclick holding bow:
set {_x} to x-coordinate of player
set {_y} to y-coordinate of player + 1.6
set {_z} to z-coordinate of player
set {_world} to world of player
set {_yaw} to player's yaw
set {_pitch} to player's pitch
shoot arrow from player and location({_x}, {_y}, {_z}, {_world}, {_yaw}, {_pitch}) at speed 2.8

on damage:
attacker is player
victim is not player
projectile is set

set damage to metadata "damage" of projectile

on shoot:
set metadata "damage" of projectile to 30
on leftclick holding bow:
set {_x} to x-coordinate of player
set {_y} to y-coordinate of player + 1.6
set {_z} to z-coordinate of player
set {_world} to world of player
set {_yaw} to player's yaw
set {_pitch} to player's pitch
shoot arrow from player and location({_x}, {_y}, {_z}, {_world}, {_yaw}, {_pitch}) at speed 2.8

on damage:
attacker is player
victim is not player
projectile is set

set damage to metadata "damage" of projectile

on shoot:
set metadata "damage" of projectile to 30
だといけました。last shot entityだと違うエンティティ返されちゃいます
unnnnnnnnnnn
unnnnnnnnnnn16mo ago
metadataで解決したみたいだけど、last spawned entityでもだめ? どっちも同じ構文だったわ
るび
るびOP16mo ago
last spawned entityだとダメでしたね

Did you find this page helpful?