When you create an iron golem manually (4 iron blocks with a pumpkin on top), it automatically labels you as its creator, and will not attack when you hit it. However, using the /summon iron_golem
command does no such thing. Is there something I'm missing?
Minecraft – way to be the ‘creator’ of an iron golem when you summon it with a command
minecraft-commandsminecraft-java-edition
Related Topic
- Minecraft – How does one make a lightning sword in vanilla Minecraft
- Minecraft – Command created blocks update light level
- Minecraft – How to turn Passive mobs Hostile
- Minecraft – Armor not providing armor bars/protection
- Minecraft – Having problems with the ‘distance=’ command in Minecraft 1.13.2
- Minecraft – In Minecraft, How to create floating grass with command blocks
- Minecraft – Ender Dragons spawned with commands center their behavior at (0,0). Can this be changed
Best Answer
Let's look at the Minecraft Wiki, specifically, the Iron Golem's Data Values: These are the NBT tags being held by the Iron Golem. It looks like the Iron Golem has its own tag that shows whether it was created by a player.
When creating an Iron Golem manually, this tag is set to
1
(true). But the/summon
command does no such thing by default.But there is a way! Although
/summon
does not set NBT tags by default, you can tell it to by specifying the tags after the summon position.Try this command:
This command summons an Iron Golem with the
PlayerCreated
tag set to1b
.Learn more about these concepts on the Minecraft Wiki:
/summon
Command