We've split up the commands, scripting and mods, and add ons category! Please be sure you get your thread in the right place.

22

Entity selector option to exclude self

3 Comments

Please sign in to leave a comment.

Sorted by oldest
  • 0
    Registered User commented
    Comment actions Permalink

    What about @e[type=!@s] 

  • 1
    Registered User commented
    Comment actions Permalink

    Conbonji That is not correct, the correct way is to use the name argument:

    @a[name=!YOUR_NAME]
  • 0
    Registered User commented
    Comment actions Permalink

    That would be a really nice addition. For example, if you want to retrieve the closest entity with the same tag, you can simply use @n[tag=xy, exclude=self] and there you have it. I could also imagine something like @o (o for others).

    But why not use @n[tag=!my_tag]?
    Sometimes you have two or more entities with the same tags and you want to retrieve the closest entity with the same tags. In that case, you currently have to assign a new temporary tag to the executing entity (@s), search for the closest entity with those tags, and then remove the tag. Here, it would be great to have something like @o or @n[exclude=self].