As I don't know how exactly local coordinates are supposed to work, this report is a guess.
To reproduce this, you'll need two files in a datapack:
an advancement to trigger a function and the function where multiple different local coordinates are used.
In the example files to summon a wither-skeleton place a carved pumpkin ontop of 2 coal blocks.
when you jump to place the pumpkin on the coal blocks sometimes there will spawn 2 skeletons.
I think this must be happening because the local coordinates refer to the same position under special circumstances. As the commands are executed in the same tick they probably should refer to different global coordinates.
**update
sometimes it happens too if you just stand on a block to place the pumpkin. But it is hard to reproduce. It feels random somehow
**
Advancement:
{
"parent": "pack:trigger/root",
"criteria": {
"block_placed": {
"trigger": "minecraft:placed_block",
"conditions": {
"block": "minecraft:carved_pumpkin"
}
}
},
"rewards": {
"function": "pack:create_wither_skeleton"
}
}
And the function:
advancement revoke @s only pack:trigger/create_wither_skeleton
# summon wither skeleton
execute anchored eyes positioned ^ ^ ^1 if block ~ ~ ~ minecraft:carved_pumpkin if block ~ ~-1 ~ minecraft:coal_block if block ~ ~-2 ~ minecraft:coal_block run summon minecraft:wither_skeleton ~ ~-2 ~ {ArmorItems: [{},{},{}, {id: "minecraft:carved_pumpkin", Count:1b}], HandItems:[{id: "minecraft:stone_sword", Count:1b},{id: "minecraft:shield", Count:1b}]}
execute anchored eyes positioned ^ ^ ^2 if block ~ ~ ~ minecraft:carved_pumpkin if block ~ ~-1 ~ minecraft:coal_block if block ~ ~-2 ~ minecraft:coal_block run summon minecraft:wither_skeleton ~ ~-2 ~ {ArmorItems: [{},{},{}, {id: "minecraft:carved_pumpkin", Count:1b}], HandItems:[{id: "minecraft:stone_sword", Count:1b},{id: "minecraft:shield", Count:1b}]}
execute anchored eyes positioned ^ ^ ^3 if block ~ ~ ~ minecraft:carved_pumpkin if block ~ ~-1 ~ minecraft:coal_block if block ~ ~-2 ~ minecraft:coal_block run summon minecraft:wither_skeleton ~ ~-2 ~ {ArmorItems: [{},{},{}, {id: "minecraft:carved_pumpkin", Count:1b}], HandItems:[{id: "minecraft:stone_sword", Count:1b},{id: "minecraft:shield", Count:1b}]}
execute anchored eyes positioned ^ ^ ^4 if block ~ ~ ~ minecraft:carved_pumpkin if block ~ ~-1 ~ minecraft:coal_block if block ~ ~-2 ~ minecraft:coal_block run summon minecraft:wither_skeleton ~ ~-2 ~ {ArmorItems: [{},{},{}, {id: "minecraft:carved_pumpkin", Count:1b}], HandItems:[{id: "minecraft:stone_sword", Count:1b},{id: "minecraft:shield", Count:1b}]}
execute anchored eyes positioned ^ ^1 ^1 if block ~ ~ ~ minecraft:carved_pumpkin if block ~ ~-1 ~ minecraft:coal_block if block ~ ~-2 ~ minecraft:coal_block run summon minecraft:wither_skeleton ~ ~-2 ~ {ArmorItems: [{},{},{}, {id: "minecraft:carved_pumpkin", Count:1b}], HandItems:[{id: "minecraft:stone_sword", Count:1b},{id: "minecraft:shield", Count:1b}]}
execute anchored eyes positioned ^ ^1 ^2 if block ~ ~ ~ minecraft:carved_pumpkin if block ~ ~-1 ~ minecraft:coal_block if block ~ ~-2 ~ minecraft:coal_block run summon minecraft:wither_skeleton ~ ~-2 ~ {ArmorItems: [{},{},{}, {id: "minecraft:carved_pumpkin", Count:1b}], HandItems:[{id: "minecraft:stone_sword", Count:1b},{id: "minecraft:shield", Count:1b}]}
execute anchored eyes positioned ^ ^1 ^3 if block ~ ~ ~ minecraft:carved_pumpkin if block ~ ~-1 ~ minecraft:coal_block if block ~ ~-2 ~ minecraft:coal_block run summon minecraft:wither_skeleton ~ ~-2 ~ {ArmorItems: [{},{},{}, {id: "minecraft:carved_pumpkin", Count:1b}], HandItems:[{id: "minecraft:stone_sword", Count:1b},{id: "minecraft:shield", Count:1b}]}
execute anchored eyes positioned ^ ^1 ^4 if block ~ ~ ~ minecraft:carved_pumpkin if block ~ ~-1 ~ minecraft:coal_block if block ~ ~-2 ~ minecraft:coal_block run summon minecraft:wither_skeleton ~ ~-2 ~ {ArmorItems: [{},{},{}, {id: "minecraft:carved_pumpkin", Count:1b}], HandItems:[{id: "minecraft:stone_sword", Count:1b},{id: "minecraft:shield", Count:1b}]}
# at last! - clear structure
execute anchored eyes positioned ^ ^ ^1 if block ~ ~ ~ minecraft:carved_pumpkin if block ~ ~-1 ~ minecraft:coal_block if block ~ ~-2 ~ minecraft:coal_block run fill ~ ~ ~ ~ ~-2 ~ minecraft:air replace
execute anchored eyes positioned ^ ^ ^2 if block ~ ~ ~ minecraft:carved_pumpkin if block ~ ~-1 ~ minecraft:coal_block if block ~ ~-2 ~ minecraft:coal_block run fill ~ ~ ~ ~ ~-2 ~ minecraft:air replace
execute anchored eyes positioned ^ ^ ^3 if block ~ ~ ~ minecraft:carved_pumpkin if block ~ ~-1 ~ minecraft:coal_block if block ~ ~-2 ~ minecraft:coal_block run fill ~ ~ ~ ~ ~-2 ~ minecraft:air replace
execute anchored eyes positioned ^ ^ ^4 if block ~ ~ ~ minecraft:carved_pumpkin if block ~ ~-1 ~ minecraft:coal_block if block ~ ~-2 ~ minecraft:coal_block run fill ~ ~ ~ ~ ~-2 ~ minecraft:air replace
execute anchored eyes positioned ^ ^1 ^1 if block ~ ~ ~ minecraft:carved_pumpkin if block ~ ~-1 ~ minecraft:coal_block if block ~ ~-2 ~ minecraft:coal_block run fill ~ ~ ~ ~ ~-2 ~ minecraft:air replace
execute anchored eyes positioned ^ ^1 ^2 if block ~ ~ ~ minecraft:carved_pumpkin if block ~ ~-1 ~ minecraft:coal_block if block ~ ~-2 ~ minecraft:coal_block run fill ~ ~ ~ ~ ~-2 ~ minecraft:air replace
execute anchored eyes positioned ^ ^1 ^3 if block ~ ~ ~ minecraft:carved_pumpkin if block ~ ~-1 ~ minecraft:coal_block if block ~ ~-2 ~ minecraft:coal_block run fill ~ ~ ~ ~ ~-2 ~ minecraft:air replace
execute anchored eyes positioned ^ ^1 ^4 if block ~ ~ ~ minecraft:carved_pumpkin if block ~ ~-1 ~ minecraft:coal_block if block ~ ~-2 ~ minecraft:coal_block run fill ~ ~ ~ ~ ~-2 ~ minecraft:air replace
^ ^ ^1 and ^ ^1 ^1 may refer to the same block if the looking direction is diagonal; it’s some simple math:
lets say the player looks at an angle of 45 degrees downward and an angle of 0 on the other rotation, a block is 1x1 on our line.
to get from the bottom left corner to the top right, you need to move “up” by the root of (1^2 + 1^2) which is roughly 1.41
so if ^ ^ ^1 hits the bottom left corner, ^ ^1 ^1 will select the same block; ^ ^1.42 ^1 will never select that block.