Spawning and modifying entity at the same time duplicates the entity.
James103 opened this issue · 1 comments
Currently (Carpet Mod 1.3.22 in Minecraft 1.15.2), if you execute the following command, instead of spawning one zombie, it spawns two zombies, one of which is modified by Scarpet.
Steps to reproduce
- Flatten land near 0,0 by doing
/fill -8 64 -8 8 128 8 air
- Fill in land near 0,0 by doing
/fill -8 60 -8 8 63 8 stone
- Execute the command
/script run modify(spawn('zombie',block(0,77,0)), 'health', 1)
. - The zombie will be duplicated on spawning.
- One of the zombies will die (the zombie modified by Scarpet), while the other will survive (the original zombie produced by just the
spawn(...)
function).
The only log entries that were produced are the following:
[21:59:02] [Server thread/INFO]: [Player: = Zombie (1178µs)]
[21:59:02] [main/INFO]: [CHAT] = Zombie (1178µs)
Workaround
Wait at least one tick between spawning the entity and modifying the entity, to avoid a possible race condition causing the entity to be duplicated.