Is it possible to recharge a respawn anchor automatically

minecraft-bedrock-editionminecraft-commands

I am trying to make a time bomb for a mini game map, involving a pillar of quartz, and a respawn anchor on the top. Gradually, the respawn anchor recharges, and once it has been fully charged (because you’re in the overworld) it explodes.

The issue is that I need to automatically recharge the anchor to a full charge, and then blow it up, without any player involvement.


Is there a way to fully recharge a respawn anchor automatically and then blow it up without player involvement?

Best Answer

After doing a little digging around with the /setblock command, you can actually set how many charges a respawn anchor has by using the blockstate option like so:

no charges: /setblock ~~~ respawn_anchor 0

1 charge: /setblock ~~~ respawn_anchor 1

2 charges: /setblock ~~~ respawn_anchor 2

3 charges: /setblock ~~~ respawn_anchor 3

4 charges: /setblock ~~~ respawn_anchor 4

For my problem, I can then clear the respawn anchor, then summon tnt at it’s position, simulating an explosion!