Entities spawn fixes
This commit is contained in:
parent
e17271d1dd
commit
24b4b722c2
3 changed files with 17 additions and 3 deletions
|
@ -21,7 +21,7 @@ public class HostileEntityMixin {
|
|||
@Inject(method = "canSpawnInDark", at = @At(value = "RETURN"), cancellable = true)
|
||||
private static void endermenCheck(EntityType<? extends HostileEntity> type, ServerWorldAccess serverWorldAccess, SpawnReason spawnReason, BlockPos pos, Random random, CallbackInfoReturnable<Boolean> info) {
|
||||
boolean canSpawn = info.getReturnValue();
|
||||
if (canSpawn && spawnReason == SpawnReason.NATURAL) {
|
||||
if (canSpawn && spawnReason == SpawnReason.NATURAL && type == EntityType.ENDERMAN) {
|
||||
Box box = new Box(pos).expand(16);
|
||||
List<EndermanEntity> entities = serverWorldAccess.getEntitiesByClass(EndermanEntity.class, box, (entity) -> { return true; });
|
||||
info.setReturnValue(entities.size() < 6);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue