1.20.1 Raycast Doesn't Work in 1.20.4
My Portal Gun Mod uses a raycast to spawn portals where I look. Now, it just spawns portals on top of the players head for some reason. How do I fix this? I think maybe it has something to do with my tags? I'll link a download to the datapack if that will help. #main
- execute as @a[scores={use.portal_gun=1},nbt={SelectedItemSlot:0,Inventory:[{Slot:-106b,tag:{portal:1b}}]}] at @s anchored eyes positioned ^ ^ ^ run function portal_gun:shoot_portal1
#shoot_portal1
- particle dust 0 0.4 0.8 1 ~ ~ ~ 0.769 0.486 0.000 1 0 force
- execute unless block ~ ~ ~ #portal_gun:ignore run function portal_gun:spawn_portal1
- execute if entity @e[type=#portal_gun:hit,distance=..2] run function portal_gun:spawn_portal1
- execute if entity @s[distance=..256] unless entity @e[type=#portal_gun:hit,distance=..2] if block ~ ~ ~ #portal_gun:ignore positioned ^ ^ ^.25 run function portal_gun:shoot_portal1