How can I make a wolf tamed by an arbitrary player using command blocks?

In a map I'm making, I have a shop where players can buy rewards for collecting points (things like upgraded stats, items, etc.). One thing I'd like to have is a pet shop, where the player can buy a dog, cat, horse, or skeleton horse. When they buy one, it should become tamed by the player who bought it. There's a data tag on these mobs called OwnerUUID, which must be set to the owner's UUID to make this work...so how can I set it to a player's UUID when anyone could be playing the map, and any player could buy an animal? In other words, how do I calculate the player's UUID and set a data tag to it if their username/account is unknown? If there's no way to do this, how can I make an animal tamed another way with command blocks?

8

2 Answers

I don't know why so many players say this isn't possible. In fact, it is simple!

Just enter this command into a command block:

/summon Wolf ~ ~1 ~ {Owner:Notch}

Of course, the name Notch could be replaced with the player's name that you wanted to have it tamed to. @p does not work! (The command will generate a tamed wolf one block above the command block, tamed to the person of your liking.)

1

Summon a willed wolf with a command block then have the same circuit that activated the first command block to activate another command block which will give the player some bones.

Sorry for not getting the exact answer you wanted, but this will still work because this way you don't need to know the players name and they still get their pet wolf.

example

command block one command block two
/summon wolf ~ ~1 ~ /give @p bone 15

You Might Also Like