#Raycast System not detecting any entity (part 3)
1 messages · Page 1 of 1 (latest)
"criteria": {
"loaded_resonant_crossbow": {
"trigger": "minecraft:shot_crossbow",
"conditions": {
"item": {
"items": ["minecraft:crossbow"],
"components": {
"minecraft:custom_data": {
"resonance": true
}
}
},
"player": {
"equipment": {
"offhand": {
"items": ["minecraft:echo_shard"]
}
}
}
}
}
},
"rewards": {
"function": "clockwork:echo/echo"
}
}``` **this code is for triggering the raycast**
kill @e[type=arrow,distance=..2]
scoreboard players set @s ray_dist 0
execute anchored eyes positioned ^ ^ ^ run function clockwork:echo/echo2
clear @s minecraft:echo_shard 1``` **this code is for initialising the raycast**
execute positioned ^ ^ ^ if entity @e[type=!player,distance=..0.7,limit=1] run function clockwork:echo/echo3
execute unless block ~ ~ ~ air run return 0
scoreboard players add @s ray_dist 1
particle minecraft:sonic_boom ^ ^ ^ 0 0 0 0 1 force
execute positioned ^ ^ ^0.5 run function clockwork:echo/echo2``` **this part actually does the raycast**
return 0``` **this is what happens when it detects an entity**
so here i shared all relevant parts of this raycast system and now idk why its not detecting any entity
In what way does it not work?
You probably want to try debugging your datapacks
you're not running the function as the entity
you're only running the function as the player if the entity exists
so what will be the fixed version of it
it just dont bother entities at all
plz dont ghost this thread like the other ones , i genuinly require a fix at this point , what Silabear said does look like an appropriate answer but i just cannot understand it
Please be patient
On line 2 of the function Silabear pointed out, just change if entity to as