From 9ff511a922992bdacb7dc88ef018bb0220a34d08 Mon Sep 17 00:00:00 2001 From: itsmeow Date: Sat, 12 Jun 2021 13:22:51 -0400 Subject: [PATCH] Prevent hirschgeists from spawning naturally within 300 blocks of another hirschgeist --- src/main/java/dev/itsmeow/whisperwoods/init/ModEntities.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/dev/itsmeow/whisperwoods/init/ModEntities.java b/src/main/java/dev/itsmeow/whisperwoods/init/ModEntities.java index 3ec4bf7..04587f0 100644 --- a/src/main/java/dev/itsmeow/whisperwoods/init/ModEntities.java +++ b/src/main/java/dev/itsmeow/whisperwoods/init/ModEntities.java @@ -11,6 +11,7 @@ import net.minecraft.entity.EntityClassification; import net.minecraft.entity.MobEntity; import net.minecraft.item.Items; +import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.world.Difficulty; import net.minecraftforge.common.BiomeDictionary.Type; import net.minecraftforge.eventbus.api.IEventBus; @@ -70,6 +71,7 @@ public static void subscribe(IEventBus modBus) { public static final EntityTypeContainer HIRSCHGEIST = H.add(EntityHirschgeist.class, EntityHirschgeist::new, "hirschgeist", b -> b .spawn(EntityClassification.CREATURE, 2, 1, 1) + .defaultPlacement((t, w, e, p, r) -> w.getEntitiesWithinAABB(EntityHirschgeist.class, new AxisAlignedBB(p).grow(300D)).size() == 0) .egg(0xfffff, 0x00000) .size(3F, 4F) .biomes(Type.FOREST));