Skip to content

Commit

Permalink
Reorganize iris:get_coordinates to kill the marker only at the end
Browse files Browse the repository at this point in the history
  • Loading branch information
Aeldrion committed Oct 14, 2024
1 parent cf04ce0 commit c81cdae
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions data/iris/function/get_hitbox/entity.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ scoreboard players operation $entity_{x} iris = ${x} iris
scoreboard players operation $entity_{y} iris = ${y} iris
scoreboard players operation $entity_{z} iris = ${z} iris
execute at @s summon minecraft:marker run function iris:get_position/get_coordinates
kill @e[type=minecraft:marker, tag=iris.coordinate_getter]
scoreboard players operation $entity_[x] iris >< $[x] iris
scoreboard players operation $entity_[y] iris >< $[y] iris
scoreboard players operation $entity_[z] iris >< $[z] iris
Expand Down
3 changes: 2 additions & 1 deletion data/iris/function/get_position/get_coordinates.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
# @within iris:get_position/main
# @within iris:get_hitbox/entity

tag @s add iris.coordinate_getter

# Get integer coordinates
data modify storage iris:data Pos set from entity @s Pos
execute store result score $[x] iris store result storage iris:args x int -1 run data get storage iris:data Pos[0]
Expand All @@ -21,4 +23,3 @@ execute store result score ${z} iris run data get storage iris:data Pos[2] 10000

# Clean up
data remove storage iris:data Pos
kill @s
1 change: 1 addition & 0 deletions data/iris/function/get_position/main.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,4 @@

function iris:get_position/get_coordinates
function iris:get_position/get_rotation
kill @s

0 comments on commit c81cdae

Please sign in to comment.