[solved] How can I tell if a given UUID belongs to a player?

Discussion in 'CommandHelper' started by malon, Nov 26, 2017.

  1. malon

    malon Member

    I'm looping through a bunch of entities, but how can I tell if it's a player?

    Thanks, hopefully I'll figure it out before anyone reads this and I don't have to be embarrassed.

    edit:
    Yay, i found it.

    get_player_from_entity_id()
  2. PseudoKnight

    PseudoKnight Well-Known Member Developer

    ponline(@uuid) is a good one. Almost any player function takes a UUID.

    get_player_from_entity_id() is slower and probably ripe for deprecation. At the very least I want to change how it works, because right now it loops through living entities. This means it can even fail to find a player during certain events.
  3. PseudoKnight

    PseudoKnight Well-Known Member Developer

    Another is entity_type(@uuid) == 'PLAYER'.