@@ -847,8 +847,22 @@ IF (has_entity_locators) {
847847 execute on passengers if entity @s[tag=<%TAGS.GLOBAL_DATA()%>] run block zzz/as_all_locators/as_data {
848848 REPEAT (Object.values(rig.nodes).filter(node => node.type === 'locator' && node.config?.use_entity)) as locator {
849849 data modify storage <%temp_storage%> args.uuid set from entity @s data.locators.<%locator.storage_name%>.uuid
850+
851+ IF (debug_mode) {
852+ scoreboard players set #aj.check <%OBJECTIVES.I()%> 0
853+ }
854+
850855 block execute_as_uuid { with storage <%temp_storage%> args
851- $execute as $(uuid) run $(command)
856+ IF (debug_mode) {
857+ # If the function successfully instantiated, the provided command is valid.
858+ scoreboard players set #aj.check <%OBJECTIVES.I()%> 1
859+ }
860+
861+ $execute as $(uuid) run return run $(command)
862+ }
863+
864+ IF (debug_mode) {
865+ execute if score #aj.check <%OBJECTIVES.I()%> matches 0 run tellraw @a <%TELLRAW.LOCATOR_COMMAND_FAILED_TO_EXECUTE({text: locator.storage_name, color: 'aqua'})%>
852866 }
853867 }
854868 }
@@ -868,8 +882,22 @@ IF (has_entity_locators) {
868882 execute on passengers if entity @s[tag=<%TAGS.GLOBAL_DATA()%>] run block zzz/as_all_locators/as_data {
869883 REPEAT (Object.values(rig.nodes).filter(node => node.type === 'locator' && node.config?.use_entity)) as locator {
870884 data modify storage <%temp_storage%> args.uuid set from entity @s data.locators.<%locator.storage_name%>.uuid
885+
886+ IF (debug_mode) {
887+ scoreboard players set #aj.check <%OBJECTIVES.I()%> 0
888+ }
889+
871890 block execute_as_uuid { with storage <%temp_storage%> args
872- $execute as $(uuid) at @s run $(command)
891+ IF (debug_mode) {
892+ # If the function successfully instantiated, the provided command is valid.
893+ scoreboard players set #aj.check <%OBJECTIVES.I()%> 1
894+ }
895+
896+ $execute as $(uuid) at @s run return run $(command)
897+ }
898+
899+ IF (debug_mode) {
900+ execute if score #aj.check <%OBJECTIVES.I()%> matches 0 run tellraw @a <%TELLRAW.LOCATOR_COMMAND_FAILED_TO_EXECUTE({text: locator.storage_name, color: 'aqua'})%>
873901 }
874902 }
875903 }
@@ -933,12 +961,26 @@ IF (has_locators) {
933961 execute at @s on passengers if entity @s[tag=<%TAGS.GLOBAL_DATA()%>] run block zzz/at_all_locators/as_data {
934962 REPEAT (Object.values(rig.nodes).filter(node => node.type === 'locator')) as locator {
935963 data modify storage <%temp_storage%> args merge from entity @s data.locators.<%locator.storage_name%>
964+
965+ IF (debug_mode) {
966+ scoreboard players set #aj.check <%OBJECTIVES.I()%> 0
967+ }
968+
936969 block execute_at_transform { with storage <%temp_storage%> args
970+ IF (debug_mode) {
971+ # If the function successfully instantiated, the provided command is valid.
972+ scoreboard players set #aj.check <%OBJECTIVES.I()%> 1
973+ }
974+
937975 $execute \
938976 positioned ^$(px) ^$(py) ^$(pz) \
939977 rotated ~$(ry) ~$(rx) \
940978 run $(command)
941979 }
980+
981+ IF (debug_mode) {
982+ execute if score #aj.check <%OBJECTIVES.I()%> matches 0 run tellraw @a <%TELLRAW.LOCATOR_COMMAND_FAILED_TO_EXECUTE({text: locator.storage_name, color: 'aqua'})%>
983+ }
942984 }
943985 }
944986 }
0 commit comments