Say I have a chest in a world on my server that isn't in my spawn world, and I would like to run a command from the console to put an item in it, the usual replaceitem command always throws the error that the position is not loaded.

How do I switch which world the console is running that command on, or how do I add a flag to the command to specify the world, or how do I otherwise place an item into a chest in a world other than the spawn world?

1 Answer 1


As long as the chest/chunk is loaded you can use execute in.

In your case it would be something like this:

/execute in minecraft:<your_other_world> run <your_command_here>

For example:

/execute in minecraft:world run summon creeper 10 70 10
  • IIRC it's possible to load chunks by teleporting Armor Stands there. If that also works across dimensions via execute in, it would be a good addition to the answer.
    – Egor Hans
    Mar 12, 2021 at 11:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .