Skip to content

Minecraft

Minecraft stuffs, mostly command blocks

Show Feedback

  • /gamerule sendCommandFeedback true
  • /gamerule commandBlockOutput true

Building an automatic Iron Golem spawner

Obviously, you can change this to something else
This is in 1.21.10 Java Edition

  1. Perform the following commands

    • /scoreboard objectives add WorldTime dummy
    • /scoreboard objectives add IsNight dummy
  2. Create a Repeat, Unconditional, Always Active Command Block with the following:

    • /execute store result score #WorldTime WorldTime run time query daytime
  3. Create a Chain, Conditional, Always Active Command Block with the following:

    • /execute if score #WorldTime WorldTime matches 13000 if score #Flag IsNight matches 0 run summon minecraft:iron_golem ~ -1 ~
    • NOTE: Replace ~ -1 ~ to the location you want the Iron Golem summoned
  4. Create a Chain, Unconditional, Always Active Command Block with the following:

    • /execute if score #WorldTime WorldTime matches 12000 run scoreboard players set #Flag IsNight 0
  5. Create a Chain, Unconditional, Always Active Command Block with the following:

    • /execute if score #WorldTime WorldTime matches 14000 run scoreboard players set #Flag IsNight 1

IMPORTANT: You need to put each block connected to teach other, facing the same direction.