Help prevent mob from spawning underground.

Started by platrbx on

Topic category: Help with Minecraft modding (Java Edition)

Joined Apr 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Help prevent mob from spawning underground.

Im making a new mob that spawns in a biome, however whatever i do i cant prevent it from spawning underground. Here are the details of the mob.

It's a mob type because it attacks (not sure if this affects anything)

The spawning is ambient

There is a procedure that checks if there is cave air, and if there is, it will not spawn but it doesnt work

if not get block at xyz = cave air return true else return false

 

Please give any ideas, thank you.

Joined Aug 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
check the light level…
Wed, 04/02/2025 - 16:29

check the light level instead, also i have the same problem

Joined Jul 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
theres a block that checks…
Wed, 04/02/2025 - 19:18

theres a block that checks if the current position can see the sky. that will probably work