This solution is based on defining the person closest to a wolf when it first sits down as it's tamer.
The reason for this workaround is twofold:
- Players don't have a "wolves tamed" statistic
- Wolves don't have a "tamed" entry in their NBT, and it's not possible to look for an empty "ownerUUID"
Start with the following commands.
/scoreboard objective add isTamed dummy
/scoreboard objective add wolvesTamed dummy Wolves Tamed
This will add an objective that is used to check for tamed wolves, and another for the players.
Now run the following commands on a clock
/scoreboard players add @e[type=Wolf] isTamed 1 {Sitting:1}
/scoreboard players add @e[type=Wolf,score_isTamed_min=3] isTamed -1
/execute @e[type=Wolf,score_isTamed=1,score_isTamed_min=1] scoreboard players add @p[r=3] wolvesTamed 1
This will continuously increase the isTamed
objective by 1 as long as the wolf sits. This is followed by decreasing it by one if it is greater than 2 (this is not technically necessary, but keeps the scores low)
In addition, the player closest to a wolf (and within 3m) with an isTamed
score of exactly 1 (which can only happen when it first sits down) will have their wolvesTamed
score increased by 1.
There might be an issue with the last command, because wolves might not be able to use "cheats". In this case, you would need to find a way to use the /trigger
command instead.
stat.useItem.minecraft.bone
doesn't work. You can track number of animals bred, but not how many animals you've tamed. – Unionhawk♦ Oct 8 '14 at 7:05@e[type=TamedWolf,Owner=...]
or something like that. – aytimothy Oct 8 '14 at 8:46