I have a sword that spawns an entity (a "projectile") which is supposed to move forward and damage mobs it hits. But when I spawn multiple, only the entity closest to the world origin will move and the next entity only moves when the one before it dies. None of the projectiles are actually damaging anything like they should... When the entity is in the world, all of the code other than that entity's process will stop. (The for (let player of world.getPlayers()) { player.runCommandAsync('titleraw @s actionbar {"rawtext": [{"text": "§9✎"}, {"score":{"name": "@s","objective": "mana"}}]}'); } for example, will not run until all the entities are dead.)
I'm using @minecraft/server 1.12.0-beta
For some reason removing all of ```js
let player = entity.dimension.getPlayers({
closest:1
});
let proj1hitentities = entity.dimension.getEntities({
maxDistance: 2,
excludeTypes: ['villager', 'armor_stand', 'xp_orb', 'item', 'npc', 'box:projectile1'],
excludeNames: [player.name],
location: entity.location,
closest:1
});
proj1hitentities.applyDamage(500)
if (proj1hitentities){
entity.kill();
}