Started by
progamezia
on
Topic category: Help with Minecraft modding (Java Edition)
Hello!I am trying to give the entity nearest to the player some effects when an item is used.All the other things are working except that the negative effects are being given to the player who used the item because its the nearest entity.Is there any way to check for nearest entity other than the current player.I would like this to work with other nearby players and not just mobs,so any help would be appreciated!
Thank you!
You would have to use the entity iterator block, if you do want to heres a procedure i made: https://imgur.com/a/UE0LqOe
Actually i made a different one but this one might not work idk tho i didnt test it: https://imgur.com/a/8SoLbhI
alright,i will try them and inform you if they work.
Thank you!
The entity iterator one works perfectly and just like i wanted it to,thank you so much!
I'm having a similar problem but I want to target the single nearest entity instead of all nearby entities. The solutions Chasebear777 gave don't work for me since the first one targets all nearby entities and the 2nd just simply doesn't work.
Is there a way to do the same thing but with only a single target?
SuperUltraNinja do "and: not: nearest entity = event/target entity"
I think there might be a problem if the nearest entity isn't a player because you don't check whether the nearest entity's a player. I think it would work with <is entity subtype of <entitytype>>.