Is it possible to test for mobs within an area?

Started by Rye on Sun, 03/22/2020 - 15:04

Topic category: Help with modding

Last seen on 11:05, 25. May 2020
Joined Mar 2020
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • Comments:
Is it possible to test for mobs within an area?
Sun, 03/22/2020 - 15:04

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 20:34, 26. May 2020
Joined Nov 2019
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • 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 11:05, 25. May 2020
Joined Mar 2020
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • 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:49, 26. May 2020
Joined Apr 2019
User points:

User statistics:

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

You can implement something like area effect cloud.