Skip to content

Commit 5d6368f

Browse files
SnaveSutitgitbutler-client
authored andcommitted
✨ Improve error messages for as_all_locators and similar functions
1 parent 1708e54 commit 5d6368f

16 files changed

Lines changed: 542 additions & 78 deletions

File tree

src/global.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/// <reference path="D:/github-repos/snavesutit/blockbench-types/types/index.d.ts"/>
1+
/// <reference path="/var/mnt/ssd2/repos/snavesutit/blockbench-types/types/index.d.ts"/>
22
/// <reference path="./blockbenchTypeMods.d.ts"/>
33

44
declare module '*.png' {

src/systems/datapackCompiler/1.20.4/animation.mcb

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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
}

src/systems/datapackCompiler/1.20.4/static.mcb

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -422,8 +422,22 @@ IF (has_entity_locators) {
422422
execute on passengers if entity @s[tag=<%TAGS.GLOBAL_DATA()%>] run block zzz/as_all_locators/as_data {
423423
REPEAT (Object.values(rig.nodes).filter(node => node.type === 'locator' && node.config?.use_entity)) as locator {
424424
data modify storage <%temp_storage%> args.uuid set from entity @s data.locators.<%locator.storage_name%>.uuid
425+
426+
IF (debug_mode) {
427+
scoreboard players set #aj.check <%OBJECTIVES.I()%> 0
428+
}
429+
425430
block execute_as_uuid { with storage <%temp_storage%> args
426-
$execute as $(uuid) run $(command)
431+
IF (debug_mode) {
432+
# If the function successfully instantiated, the provided command is valid.
433+
scoreboard players set #aj.check <%OBJECTIVES.I()%> 1
434+
}
435+
436+
$execute as $(uuid) run return run $(command)
437+
}
438+
439+
IF (debug_mode) {
440+
execute if score #aj.check <%OBJECTIVES.I()%> matches 0 run tellraw @a <%TELLRAW.LOCATOR_COMMAND_FAILED_TO_EXECUTE({text: locator.storage_name, color: 'aqua'})%>
427441
}
428442
}
429443
}
@@ -443,8 +457,22 @@ IF (has_entity_locators) {
443457
execute on passengers if entity @s[tag=<%TAGS.GLOBAL_DATA()%>] run block zzz/as_all_locators/as_data {
444458
REPEAT (Object.values(rig.nodes).filter(node => node.type === 'locator' && node.config?.use_entity)) as locator {
445459
data modify storage <%temp_storage%> args.uuid set from entity @s data.locators.<%locator.storage_name%>.uuid
460+
461+
IF (debug_mode) {
462+
scoreboard players set #aj.check <%OBJECTIVES.I()%> 0
463+
}
464+
446465
block execute_as_uuid { with storage <%temp_storage%> args
447-
$execute as $(uuid) at @s run $(command)
466+
IF (debug_mode) {
467+
# If the function successfully instantiated, the provided command is valid.
468+
scoreboard players set #aj.check <%OBJECTIVES.I()%> 1
469+
}
470+
471+
$execute as $(uuid) at @s run return run $(command)
472+
}
473+
474+
IF (debug_mode) {
475+
execute if score #aj.check <%OBJECTIVES.I()%> matches 0 run tellraw @a <%TELLRAW.LOCATOR_COMMAND_FAILED_TO_EXECUTE({text: locator.storage_name, color: 'aqua'})%>
448476
}
449477
}
450478
}
@@ -508,12 +536,26 @@ IF (has_locators) {
508536
execute at @s on passengers if entity @s[tag=<%TAGS.GLOBAL_DATA()%>] run block zzz/at_all_locators/as_data {
509537
REPEAT (Object.values(rig.nodes).filter(node => node.type === 'locator')) as locator {
510538
data modify storage <%temp_storage%> args merge from entity @s data.locators.<%locator.storage_name%>
539+
540+
IF (debug_mode) {
541+
scoreboard players set #aj.check <%OBJECTIVES.I()%> 0
542+
}
543+
511544
block execute_at_transform { with storage <%temp_storage%> args
545+
IF (debug_mode) {
546+
# If the function successfully instantiated, the provided command is valid.
547+
scoreboard players set #aj.check <%OBJECTIVES.I()%> 1
548+
}
549+
512550
$execute \
513551
positioned ^$(px) ^$(py) ^$(pz) \
514552
rotated ~$(ry) ~$(rx) \
515553
run $(command)
516554
}
555+
556+
IF (debug_mode) {
557+
execute if score #aj.check <%OBJECTIVES.I()%> matches 0 run tellraw @a <%TELLRAW.LOCATOR_COMMAND_FAILED_TO_EXECUTE({text: locator.storage_name, color: 'aqua'})%>
558+
}
517559
}
518560
}
519561
}

src/systems/datapackCompiler/1.20.5/animation.mcb

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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
}

src/systems/datapackCompiler/1.20.5/static.mcb

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -422,8 +422,22 @@ IF (has_entity_locators) {
422422
execute on passengers if entity @s[tag=<%TAGS.GLOBAL_DATA()%>] run block zzz/as_all_locators/as_data {
423423
REPEAT (Object.values(rig.nodes).filter(node => node.type === 'locator' && node.config?.use_entity)) as locator {
424424
data modify storage <%temp_storage%> args.uuid set from entity @s data.locators.<%locator.storage_name%>.uuid
425+
426+
IF (debug_mode) {
427+
scoreboard players set #aj.check <%OBJECTIVES.I()%> 0
428+
}
429+
425430
block execute_as_uuid { with storage <%temp_storage%> args
426-
$execute as $(uuid) run $(command)
431+
IF (debug_mode) {
432+
# If the function successfully instantiated, the provided command is valid.
433+
scoreboard players set #aj.check <%OBJECTIVES.I()%> 1
434+
}
435+
436+
$execute as $(uuid) run return run $(command)
437+
}
438+
439+
IF (debug_mode) {
440+
execute if score #aj.check <%OBJECTIVES.I()%> matches 0 run tellraw @a <%TELLRAW.LOCATOR_COMMAND_FAILED_TO_EXECUTE({text: locator.storage_name, color: 'aqua'})%>
427441
}
428442
}
429443
}
@@ -443,8 +457,22 @@ IF (has_entity_locators) {
443457
execute on passengers if entity @s[tag=<%TAGS.GLOBAL_DATA()%>] run block zzz/as_all_locators/as_data {
444458
REPEAT (Object.values(rig.nodes).filter(node => node.type === 'locator' && node.config?.use_entity)) as locator {
445459
data modify storage <%temp_storage%> args.uuid set from entity @s data.locators.<%locator.storage_name%>.uuid
460+
461+
IF (debug_mode) {
462+
scoreboard players set #aj.check <%OBJECTIVES.I()%> 0
463+
}
464+
446465
block execute_as_uuid { with storage <%temp_storage%> args
447-
$execute as $(uuid) at @s run $(command)
466+
IF (debug_mode) {
467+
# If the function successfully instantiated, the provided command is valid.
468+
scoreboard players set #aj.check <%OBJECTIVES.I()%> 1
469+
}
470+
471+
$execute as $(uuid) at @s run return run $(command)
472+
}
473+
474+
IF (debug_mode) {
475+
execute if score #aj.check <%OBJECTIVES.I()%> matches 0 run tellraw @a <%TELLRAW.LOCATOR_COMMAND_FAILED_TO_EXECUTE({text: locator.storage_name, color: 'aqua'})%>
448476
}
449477
}
450478
}
@@ -508,12 +536,26 @@ IF (has_locators) {
508536
execute at @s on passengers if entity @s[tag=<%TAGS.GLOBAL_DATA()%>] run block zzz/at_all_locators/as_data {
509537
REPEAT (Object.values(rig.nodes).filter(node => node.type === 'locator')) as locator {
510538
data modify storage <%temp_storage%> args merge from entity @s data.locators.<%locator.storage_name%>
539+
540+
IF (debug_mode) {
541+
scoreboard players set #aj.check <%OBJECTIVES.I()%> 0
542+
}
543+
511544
block execute_at_transform { with storage <%temp_storage%> args
545+
IF (debug_mode) {
546+
# If the function successfully instantiated, the provided command is valid.
547+
scoreboard players set #aj.check <%OBJECTIVES.I()%> 1
548+
}
549+
512550
$execute \
513551
positioned ^$(px) ^$(py) ^$(pz) \
514552
rotated ~$(ry) ~$(rx) \
515553
run $(command)
516554
}
555+
556+
IF (debug_mode) {
557+
execute if score #aj.check <%OBJECTIVES.I()%> matches 0 run tellraw @a <%TELLRAW.LOCATOR_COMMAND_FAILED_TO_EXECUTE({text: locator.storage_name, color: 'aqua'})%>
558+
}
517559
}
518560
}
519561
}

src/systems/datapackCompiler/1.21.0/animation.mcb

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)