spawn only hostile mobs in caves

This commit is contained in:
p2r3
2025-08-28 02:33:31 +03:00
parent 0708a945e5
commit 5c3ec29948

View File

@@ -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