HomeJavaDatapacksSpecified random spawn points
Specified random spawn points
DatapacksJava

Specified random spawn points

by KawunDream · on Modrinth

Which Minecraft do you have?

Every version of the game needs its own build. Pick yours, then download — the wrong build installs fine and then does nothing in the game. This mod is built for Data pack only.

⬇ Download for 1.21.11–26.1.2⬇ Download for 1.21–1.21.4⬇ Download for 1.17–1.20.4
I don't know my version or loader
Open the Minecraft launcher and look at the profile you play on — it names both, like fabric-loader-1.21.4. The version also shows in the bottom-right corner of the game's main menu.
No loader in the profile name? Then it's plain Minecraft, and these mods won't run — you need Fabric or NeoForge installed first.
Specified random spawn points — screenshot 1Specified random spawn points — screenshot 2Specified random spawn points — screenshot 3

Random Spawn

This datapack allows you to set multiple spawn points. After death, the player will randomly respawn at one of these points.

What is this for?

You can use this datapack to play mini-games and PVP with your friends.

How to use

First, you need to set up spawn points. There are two ways to do this:

  1. Use the /function random_spawn:give_spawnpoint/me command to give you an armor stand. Place these armor stands on the blocks where players should spawn.
  2. Run the /function random_spawn:spawnpoint command to set a spawn point where you are standing.

Armor stands are invisible by default. To see them, you can switch to spectator mode or run the /function random_spawn:visible/enable command.

Armor stand item

⚠️ Warning

Spawn points apply to all players on the server simultaneously. Currently, it's not possible to set spawn points individually for each player.

Now when spawns are placed, players will spawn on them after death. There is one condition for a player to spawn at a point: there must not be a single player within a 10 block radius.

Toggle visibility

Enable visibility:

/function random_spawn:visible/enable

Enable visibility and additionally glow armor stands:

/function random_spawn:visible/glow

Disable visibility:

/function random_spawn:visible/disable

Toggle visibility

Delete spawn points

Delete all spawn points:

/function random_spawn:delete/all

Delete nearest spawn point within a 10 block radius:

/function random_spawn:delete/nearest

You can also enable visibility of armor stands and kill them as usual via left mouse button.

Additional functions

Teleport yourself to a random spawn:

/function random_spawn:tp

Teleport all players to a random spawns:

/function random_spawn:tp_everyone

Print the number of spawn points in the chat:

/function random_spawn:get_count_spawn

Disable datapack

To temporarily disable the datapack:

/datapack disable "file/random_spawn"

Then to turn it back on:

/datapack enable "file/random_spawn"

Command Cheatsheet

Command Description
/function random_spawn:give_spawnpoint/me give yourself armor stand
/function random_spawn:give_spawnpoint/everyone give everyone armor stand
/function random_spawn:spawnpoint set spawn point
/function random_spawn:visible/disable disable visibility
/function random_spawn:visible/enable enable visibility
/function random_spawn:visible/glow glow armor stand
/function random_spawn:delete/all delete all spawns
/function random_spawn:delete/nearest delete nearest spawn
/function random_spawn:tp teleport yourself to a random spawn
/function random_spawn:tp_everyone teleport all players to a random spawns
/function random_spawn:get_count_spawn get the number of spawns

Versions on which the datapack doesn't work:

Discord

On my Discord server, you can report bugs in my datapacks and suggest improvements. You can also order a datapack from me.

My other projects

Datapacks:

Quick facts

Install steps are the general flow for this file type — see the MC Java Mods guides for the full walkthrough.

Verified by MCModsHub

These come from our own check of the pack file, not from the source page.

Explore more