-
Bug
-
Resolution: Works As Intended
-
None
-
Minecraft 18w10d
-
Unconfirmed
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