feat: extra swarm spawn check
This commit is contained in:
parent
906263cb2b
commit
ed6776f9df
@ -40,6 +40,10 @@ data class SwarmProjectionEffect(
|
|||||||
level.random.nextInt(area.minZ(), area.maxZ()),
|
level.random.nextInt(area.minZ(), area.maxZ()),
|
||||||
)
|
)
|
||||||
spawnPos = spawnPos.atY(level.getHeight(Heightmap.Types.WORLD_SURFACE, spawnPos.x, spawnPos.z))
|
spawnPos = spawnPos.atY(level.getHeight(Heightmap.Types.WORLD_SURFACE, spawnPos.x, spawnPos.z))
|
||||||
|
if (level.getBlockState(spawnPos.below()).isAir)
|
||||||
|
return
|
||||||
|
if (!level.getBlockState(spawnPos).isAir)
|
||||||
|
return
|
||||||
ProjectedPersonEntity.entity.get().spawn(level, spawnPos, MobSpawnType.TRIGGERED)
|
ProjectedPersonEntity.entity.get().spawn(level, spawnPos, MobSpawnType.TRIGGERED)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user