Identity

Identity

3M Downloads

How to retrieve a player's identity using commands?

morceaudebois opened this issue ยท 4 comments

commented

Hi! Sorry if this isn't really a problem, but I'm not sure where else to ask.

I'm playing around with the Origins mod and I'm trying to add a canine origin with the ability to switch between human and wolf identities. I managed to do it but I would like to add a condition to toggle between the two with the same key.

I wanted to add a command condition to check for the player's identity before switching to wolf or human, but there doesn't seem to be a command in the Identity mod to get the player's identity.

I tried with /data get entity @s but it doesn't seem to be stored there. Is there a way I cloud retrieve it using a command?

Thank you!

commented

Try /identity test [player] [entity], to check, if [entity] is the current identity of [player]

commented

I actually found out about this yesterday while tinkering! Not gonna go into details but it wasn't really what I was looking for. For reference I ended up having to learn and use the /execute command, like this:

/execute if entity @s[nbt={CurrentIdentity:{id:"minecraft:wolf"}}]

Turns out the data I needed was in fact in the /data command, I just needed to look harder! Thanks again for the help ๐Ÿ˜Š

commented

Do you mean the current identity or any unlocked ones?

commented

Thanks for the reply. I mean the current equipped one