Minecraft Java Edition – How to Place an Item into a Chest When Using Multiverse

minecraft-commandsminecraft-java-edition

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?

Best Answer

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