向いた方向の一番近い草ブロックの上にarmor standが出したい

function TeleportStand(p: player, t: entity type):
execute {_p} command "/execute as %{_t}% at %{_p}% run tp ^ ^ ^%{standtpblocks}%"
add 0.1 to {standtpblocks}
if block at {_t} is grass block:
else:
set {standtpblocks} to 0
every ticks:
loop all players:
if {placestand.global} is not set:
set {placestand.global} to 0
if {placestand.%loop-player%} is not set:
set {placestand.%loop-player%} to {placestand.global}+1
add 1 to {placestand.global}
loop all entities:
if {placestand.%loop-entity-2%} > 0:
if block at loop-entity-2 is grass block:
set {ministandlocation_x} to x-coordinate of loop-entity-2
set {ministandlocation_y} to y-coordinate of loop-entity-2
add 1 to {ministandlocation_y}
set {ministandlocation_z} to z-coordinate of loop-entity-2
execute console command "/summon minecraft:armor_stand %{ministandlocarion_x}% %{ministandlocarion_y}% %{ministandlocarion_z}% {Small:1b}"
if {placestand.%loop-player%} > 0:
if {placestand.%loop-player%} = {placestand.%loop-entity-2%}:
broadcast "a"
TeleportStand(loop-player, loop-entity-2)
stop
summon an armor stand at loop-player:
set {placestand.%event-entity%} to {placestand.%player%}
function TeleportStand(p: player, t: entity type):
execute {_p} command "/execute as %{_t}% at %{_p}% run tp ^ ^ ^%{standtpblocks}%"
add 0.1 to {standtpblocks}
if block at {_t} is grass block:
else:
set {standtpblocks} to 0
every ticks:
loop all players:
if {placestand.global} is not set:
set {placestand.global} to 0
if {placestand.%loop-player%} is not set:
set {placestand.%loop-player%} to {placestand.global}+1
add 1 to {placestand.global}
loop all entities:
if {placestand.%loop-entity-2%} > 0:
if block at loop-entity-2 is grass block:
set {ministandlocation_x} to x-coordinate of loop-entity-2
set {ministandlocation_y} to y-coordinate of loop-entity-2
add 1 to {ministandlocation_y}
set {ministandlocation_z} to z-coordinate of loop-entity-2
execute console command "/summon minecraft:armor_stand %{ministandlocarion_x}% %{ministandlocarion_y}% %{ministandlocarion_z}% {Small:1b}"
if {placestand.%loop-player%} > 0:
if {placestand.%loop-player%} = {placestand.%loop-entity-2%}:
broadcast "a"
TeleportStand(loop-player, loop-entity-2)
stop
summon an armor stand at loop-player:
set {placestand.%event-entity%} to {placestand.%player%}
2 Replies
L2ck_
L2ck_OP10mo ago
playerとarmor stand2種類使っているのですがうまくいきません....armor stand2種をA,BとするとplayerとAのidが一致した時に Aを0.1block分playerの前にtpして草ブロックがあったらBを召喚するという形です
gladiolus8789
gladiolus878910mo ago
不躾な質問ですが、 向いている方向の一番近いブロック、ではなく プレイヤーが見ているブロック(target block)が草ブロックだったら、ではなにか不都合があるのでしょうか?
Want results from more Discord servers?
Add your server