How do I set the players "tame" score to 1 if they tame a wolf?

How do I set the players "tame" score to 1 if they tame a wolf? - Unrecognizable multiracial men playing chess at lumber table

I'm making a map and I need to give the player +1 for taming a wolf but I don't know the command. All I know is /scoreboard objectives add tame {part I don't know}. Then some command block that gives them the point. Then maybe testfor @p[score=tame=1].

All the commands I tried are:

  • testfor @p[team=start]
  • scoreboard objectives add tame{I don't know}
  • scoreboard players set @p{I don't know}


Best Answer

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.




Pictures about "How do I set the players "tame" score to 1 if they tame a wolf?"

How do I set the players "tame" score to 1 if they tame a wolf? -
How do I set the players "tame" score to 1 if they tame a wolf? -
How do I set the players "tame" score to 1 if they tame a wolf? - Aerial View of Soccer Field



How do you make a tamed wolf follow you on Minecraft?

You will know the wolf has been tamed when hearts appear over it and it's collar will turn red. It may take multiple tries and will consume your bone. After you tame it, you can make the dog either sit or follow you by right-clicking on it.

What happens when you tame a wolf in Minecraft?

A tamed wolf will attack any mob that its owner attacks, except for creepers. Tamed wolves whine when they have low health. You can determine your wolf's health by the position of its tail: the higher the tail, the greater the health.

How many bones does it take to tame a wolf?

Gather at least 5 bones for each wolf you plan to tame, and preferably 10 to be safe.



How to Tame a Wolf in Minecraft (All Versions)




Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.

Images: William Fortunato, Geometric Photography, Geometric Photography, Mike