fix: swarm spawn

This commit is contained in:
xtex 2023-07-11 10:02:46 +08:00
parent 7f49b0a84f
commit f6381345ae
Signed by: xtex
GPG Key ID: B918086ED8045B91

View File

@ -39,7 +39,7 @@ data class SwarmProjectionEffect(
level.random.nextInt(area.minY(), area.maxY()),
level.random.nextInt(area.minZ(), area.maxZ()),
)
spawnPos = spawnPos.atY(level.getHeight(Heightmap.Types.WORLD_SURFACE, spawnPos.x, spawnPos.z)).above()
spawnPos = spawnPos.atY(level.getHeight(Heightmap.Types.WORLD_SURFACE, spawnPos.x, spawnPos.z))
if (level.getBlockState(spawnPos.below()).isAir)
return
ProjectedPersonEntity.entity.get().spawn(level, spawnPos, MobSpawnType.TRIGGERED)