Is it possible to test for mobs within an area?

Started by Rye on

Topic category: Help with modding (Java Edition)

Last seen on 04:16, 26. Feb 2022
Joined Mar 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Is it possible to test for mobs within an area?

I'm trying to make a block that, upon right click, kills every mob of a certain type in a radius around it, then triggers something else if at least one mob is killed.

 

Is this possible without coding? I have yet to mess with code at all, but if it's necessary I'd try, any help would be great.

Last seen on 05:29, 31. Jan 2022
Joined Nov 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
use the "Execute command"…
Mon, 03/23/2020 - 19:08

use the "Execute command" procedure block (in the World Management category). Put in the command "/kill @e[type=zombie,r=20]", where the mob to kill is a zombie and radius is 20

Last seen on 04:16, 26. Feb 2022
Joined Mar 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Is there a way to check…
Tue, 03/24/2020 - 01:50

Is there a way to check whether the command actually killed anything or not, though? As I need something to trigger only if at least one mob was killed.

Last seen on 07:42, 26. Jun 2021
Joined Apr 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You can implement something…
Tue, 03/24/2020 - 07:58

You can implement something like area effect cloud.