Make mob spawn tamed

Started by JamesThatsSo on Sat, 08/17/2019 - 07:47

Topic category: Help with MCreator's application

Last seen on 22:48, 27. Aug 2019
Joined Aug 2019
User points:


  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
Make mob spawn tamed
Sat, 08/17/2019 - 07:47

Hi, I'm working on a pet based mod, it has an item that spawns a pet when the user right clicks with it.

This is the only way to get the pets, so I'd like the pet to be tamed as soon as it's spawned, as well as being a baby.


The way I attempted this was making the item run a /summon command at the current location, to spawn the mob with a very negative age and the "Owner" set to be the name of the player who used the item (Using the Entity Name option in the procedure). This, however, spawns a mob that is a baby and tamed but the owner not being the player.

Here's the odd part, if I make the same procedure spit out text instead of a command, I can type that exact text into the chat and it'll produce a mob actually tamed to me. From what I can tell, commands ran through the console handle setting the owner tag entirely differently than doing it in the chat? 

I'm not exactly attached to the idea of doing it this way, I just can't seem to figure out a way to make it spawn with both these tags. Can anyone either tell me what I'm doing wrong or recommend an alternative way to accomplish this? If there's any way to get the current entity(player)'s UUID, I believe that would fix it.

Thank you