Custom advancements - criteria involving a specific player

Discussion in 'Server & Community Management' started by takatalvi, Sep 25, 2018.

  1. Hi, today I tried creating my first custom advancement that I'd like to use on my server. I used this generator which, compared to others, seems to have more options, namely the option to specify a target entity's NBT, e.g. when creating a criterion where you need to kill the entity to get the advancement. I'd like to create an advancement in the spirit of "regicide" or "high treason", where a player will get the advancement when they kill an admin. Now I'm wondering how to do that. In the criteria, I can specify that the entity to kill will be a player, but I'm struggling with the NBT. Player entities do not seem to have their name in their NBT, so I see no way of specifying the player's name or scoreboard team in the advancement criteria. Does anyone have any experience with this? Thanks in advance!
     
  2. What about using the ID (unique UUID) which matches the players instead of the name of the players? That should be able to be referenced.
     
    • Useful Useful x 1
  3. Thanks for the reply, I didn't expect anyone to participate after a week :D
    But your post gave me the idea to look at the player data better. I ran /data get entity takatalvi and went through the lot. Filtering out the ender chest items (that's stored in the player's nbt, yes), inventory, unlocked recipes and so on, I was left with the basic player status info. Sadly, the UUID is not there, same as with the name. There is only a "worldUUID", which to me doesn't seem reliable, as it's a range of values (WorldUUIDMost and WorldUUIDLeast). Then I noticed that all the scoreboard tags are stored there. Not achievements, only string tags that the player has. That gave me an idea to give a specific tag to the desired players "admins" and the achievement's criteria will include this tag. It seems simple and effective, and also scalable - you don't have to define the specific names, you can simply tag any player and it will target them. Now just to try it :)
     
    • Like Like x 1