0

I'm trying to disguise players as mobs. I need to make sure the mob teleports to only the hider.

@p teleports to whoever is closer

@a and @r don't work either.

I have to give the player invisibility to disguise them and then tp the mob in a repeating command block with the command:

/tp @e[type=(mob)] (yourself or @p) 
2

This is a great use for scoreboard tags. You can give the player a tag and then use this tag to target that player. The command to add a tag would be:

scoreboard players tag <entity> add <tagName>

Change <entity> to the player name and <tagName> to whatever name you like.

Then your repeat command uses the specified tag in the target selector. I also recommend adding the count selector argument to prevent more then one mob from teleporting:

tp @e[type=TYPE,c=1] @a[tag=TAG]

Replace TYPE and TAG.

To remove the tag from the player:

scoreboard players tag <entity> remove <tagName>

Example commands using 'Hider' as the tag name:

/scoreboard players tag IronAnvil add Hider
tp @e[type=cow,c=1] @a[tag=Hider]
/scoreboard players tag IronAnvil remove Hider
|improve this answer|||||
0

Create a hider team, make the hider join the hider team, and execute your teleport command.

scoreboard teams add hider
scoreboard teams join hider (username)
tp @e[type=sheep] @a[team=hider]

Multiple players

The above solution is plausible if you have one player.
I will assume that all of your hiders are on the 'hider' team.
You could do this:

execute @a[team=hider] ~ ~ ~ summon sheep ~ ~ ~ 

In a repeat block:

execute @a[team=hider] ~ ~ ~ tp @e[c=1,type=sheep] @s
|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.