SHARE
TWEET

Ray casting example

MegaCrafter10 May 16th, 2019 (edited) 16 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. run in a loop:
  2.  
  3. execute as @a[scores={click=1..}] at @s run summon minecraft:armor_stand ^ ^ ^2 {Invisible:1,Invulnerable:1,NoGravity:1,Tags:["ray"]}
  4. scoreboard players reset @a[scores={click=1..}] click
  5.  
  6. execute as @e[tag=ray,tag=!rotated] at @s run tp @s ~ ~ ~ facing entity @p
  7. tag @e[tag=ray] add rotated
  8.  
  9. execute as @e[tag=ray] at @s run tp @s ^ ^ ^-0.5
  10. execute as @e[tag=ray] at @s run particle minecraft:cloud ~ ~ ~ 0.05 0.05 0.05 0.05 20
  11. execute as @e[tag=ray] at @s unless block ~ ~ ~ air run kill @s
  12.  
  13. scoreboard players add @e[tag=ray] timer 1
  14. kill @e[tag=ray,scores={timer=100}]
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top