Started by
Classic-
on
Topic category: Help with Minecraft modding (Java Edition)
I'm trying to make a system that will allow my entity to target Monster Entities withing a certain radius. Shown Here
Does anyone know how to make it not check for entities behind blocks and not target the farthest entity and target the nearest?
Edited by Classic- on Tue, 04/01/2025 - 10:55
Making it not target the last entity it finds should be easily solved by breaking out of the loop when the first entity is found.
I didn't look at your procedure that closely so forgive me if you are already doing this.
OH MY GOD THANKS SO MUCH IT WORKS!! I didn't know about the whole break out thing very well thanks for the help!
No problem :)
https://imgur.com/a/ei7EFTh
For anyone else who comes across this this procedure works and also stops attacking when the Entity Iterator goes behind something. Yeah it will still look at it still if no other target is nearby but, it will lock onto something else if its the same Entity Iterator that isn't behind something after.
Is that line of sight block a plugin?
it probably is. I couldn't tell ya I had plugins in MCreator for months now I forgot what the default blocks are.