From 5c3ec2994870938c7da8e8f4abc444f85bc6a6fb Mon Sep 17 00:00:00 2001 From: p2r3 Date: Thu, 28 Aug 2025 02:33:31 +0300 Subject: [PATCH] spawn only hostile mobs in caves --- src/main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main.c b/src/main.c index 83a6712..e7d0e35 100644 --- a/src/main.c +++ b/src/main.c @@ -328,8 +328,9 @@ void handlePacket (int client_fd, int length, int packet_id, int state) { mob_y ++; } if (mob_y != 255) { - // Spawn passive mobs during the day, hostiles during the night - if (world_time < 13000) { + // Spawn passive mobs above ground during the day, + // or hostiles underground and during the night + if (world_time < 13000 && mob_y > 48) { uint32_t mob_choice = (r >> 12) & 3; if (mob_choice == 0) spawnMob(25, mob_x, mob_y, mob_z, 4); // Chicken else if (mob_choice == 1) spawnMob(28, mob_x, mob_y, mob_z, 10); // Cow