TransWikia.com

Is there a way to be the 'creator' of an iron golem when you summon it with a command?

Arqade Asked on August 18, 2020

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?

One Answer

Let's look at the Minecraft Wiki, specifically, the Iron Golem's Data Values: Minecraft Wiki 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:

/summon minecraft:iron_golem ~ ~ ~ {PlayerCreated:1b}

This command summons an Iron Golem with the PlayerCreated tag set to 1b.

Learn more about these concepts on the Minecraft Wiki:

Correct answer by ExpertCoder14 on August 18, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP