1

I have followed a raycasting tutorial:

.

I stopped at 7: 17 because I don't need headshot detection. It says to exclude players to avoid putting the effect on yourself. However, I want to make something that hurts players. I don't want to use things that exclude everyone on a scoreboard in case more that one person tries to use it at once, on each other. What can I do?

1 Answer 1

3

To exclude players of your choice, you should be able to do something to the effect of /execute at @a[name=!Aceplante] run say hi and of course replace my name for yours. You can actually exclude as many players as you like.

If you want this to be flexible for any player running it, you could do /execute at @a[distance=0.1..] run say hi. This would execute at all players at a distance of greater than 0 (it cannot be 0 becuase that would include you/whoever is executing the command). In survival, it is impossible for players to be 0 distance away from each other due to collision, and although they technically could in creative, it is basically impossible without intentionally doing so with the /tp command. The point being it should work without issue.

2
  • yes but i dont want to have to manually put in my name. it needs to be automatic
    – 2wen
    Aug 23 at 15:03
  • Then, you could do @a[distance=0.1..] which would be all players more than 0.1 blocks away from you. It cant be 0 becuase that would include you. But that would work for any player executing the command.
    – Aceplante
    Aug 23 at 15:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .