mojira.dev
MC-232599

Setting ~ ~ ~ in a function spawns mobs at the world spawn instead of the player position

Setting ~ ~ ~ in a function spawns mobs at the world spawn instead of the player position.

This is inconsistent with commands and also, I now can't create my datapack as @p doesn't work and ~ ~ ~ spawns the mobs at world spawn.

Attachments

Comments 2

What is the expected behavior?

As a workaround, you can explicitly set the execution position with the execute command (https://minecraft.fandom.com/wiki/Commands/execute). For example, you can replace

execute if score @p ZombieTier1 matches 300 run ...
execute if score @p ZombieTier1 matches 300 run ...

with

execute at @p if score @p ZombieTier1 matches 300 run ...
execute at @p if score @p ZombieTier1 matches 300 run ...

The expected behavior was that even without the "at @p", the datapack would work correctly.

As for the version with the "at @p", thank you. It works.

W_V

(Unassigned)

Unconfirmed

(Unassigned)

1.17.1

Retrieved