Help prevent mob from spawning underground.

Started by platrbx on

Topic category: Help with modding (Java Edition)

Last seen on 09:13, 19. Jan 2024
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.