Minecraft – How to use the summon command from server console

minecraft-commandsminecraft-java-edition

I haven't found the answer to this. Can I summon an object in Minecraft from the Server console? I have the exact coordinate where I'd like an item to appear and I want to type the command from the server console window.

I tried using e.g. this command:

/summon Creeper X Y Z {powered:1}

But it returns an error:

Cannot summon the object out of the world

I'm assuming that this command is valid from an ingame relative position and not valid from the server console.

Best Answer

You can't summon an entity to an unloaded chunk; trying to do so will give you the "Cannot summon the object out of the world" error.

What you can do is summon the entity to a loaded chunk, say a world spawn chunk, and then teleport it to the desired location. You could also change the world spawn location, but this is generally inadvisable, especially for the purposes of a prank, and may still not load until a player moves into them. If you do this for a mob, you'll probably want to give it a custom name so that it doesn't despawn immediately, either in the world spawn chunks or the desired location.

Note that somebody still needs to be online and in the overworld for this to work. If that isn't the case, you'll get the same error again.