点と直方体の判定(旧dxdydz再現)
旧dxdydzのように、ある点がある直方体の範囲内に含まれるか否かの判定を行います。
今回は、判定する点と直方体の基準点(最小座標)をエンティティとします。
判定する点: <subject>
直方体の基準点(最小座標): <object>
code:style
/execute
as <subject>
at @s
facing entity <object> feet
positioned ^ ^ ^3
positioned ~-4 ~ ~
unless entity @sr=5
positioned ~4 ~-4 ~
unless entity @sr=5
positioned ~ ~4 ~-4
unless entity @sr=5
positioned as @s
positioned ~-dx ~-dy ~-dz
facing entity <object> feet
positioned as @s
positioned ^ ^ ^3
positioned ~-4 ~ ~
if entity @sr=5
positioned ~4 ~-4 ~
if entity @sr=5
positioned ~ ~4 ~-4
if entity @sr=5
run
<command>