Help to detect near entities

Started by Unmiet on

Topic category: Help with Minecraft modding (Java Edition)

Joined Apr 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Help to detect near entities

I was trying to make a sword that, when the player right-clicked, would deal 500 damage to all nearby creatures within a 20-block radius, but for some reason I can't get it to work at all. I also tried making one that would strike each nearby creature within an 8-block radius of the player with a lightning bolt, but I couldn't do that either. Does anyone know how to do this? :/ (I'm still learning MCreator)

Joined Nov 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
in the "Procedure templates"…
Sat, 02/21/2026 - 01:23

in the "Procedure templates" tab if you scroll down, there's one called "Place the nearest item entity as a block", which i believe you could adapt to your needs.

It just has the  "Does entity exist at (x) (y) (z) in square cube with size ( ) of type [ ]" block so if you find it elsewhere, you can just do that without taking it from the template procedure