Advertisement
RandomGuy32

calculate_distance_from_last_minecart_enter_squared.mcfunction

Feb 20th, 2024
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. # Calculating the x value
  2. execute as @s store result score @s charlottebuff.distance_from_last_minecart_enter_squared run data get entity @s Pos[0]
  3. scoreboard players operation @s charlottebuff.distance_from_last_minecart_enter_squared -= @s charlottebuff.entered_minecart_pos_x
  4.  
  5. # Squaring the x value
  6. scoreboard players operation @s charlottebuff.distance_from_last_minecart_enter_squared *= @s charlottebuff.distance_from_last_minecart_enter_squared
  7.  
  8. # Calculating the z value
  9. execute as @s store result score @s charlottebuff.accumulator run data get entity @s Pos[2]
  10. scoreboard players operation @s charlottebuff.accumulator -= @s charlottebuff.entered_minecart_pos_z
  11.  
  12. # Squaring the z value
  13. scoreboard players operation @s charlottebuff.accumulator *= @s charlottebuff.accumulator
  14.  
  15. # Adding both squares
  16. scoreboard players operation @s charlottebuff.distance_from_last_minecart_enter_squared += @s charlottebuff.accumulator
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement