Detecting if mob suffocating in Block? (And other checks to avoid farming?)

Started by Aroyki on

Topic category: Help with modding (Java Edition)

Last seen on 21:58, 23. Nov 2022
Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Detecting if mob suffocating in Block? (And other checks to avoid farming?)
Wed, 07/20/2022 - 23:57 (edited)

A bit of a dumb question. But, I'm asking this to try to prevent players from farming or just accidently getting a boss stuck in a block. How can I check if the entity is suffocating or make them immune? I got a procedure to use if I can check, and I know I can check if blocks in radius are air, but, there is quite a few to check per tick. Any help is greatly appreciated.

(I forgot to say, but, I'm mainly asking because I want the anti-farming procedure to ONLY activate when the mob is suffocating. Right now the mob when near blocks triggers the procedure, which is a bit irritating to fight)

Edited by Aroyki on Wed, 07/20/2022 - 23:57