Description
This mod allows map makers / server owners to change the respawn point & dimension of dimensions.
To use this mod you place a file called perfectspawn.json in the main minecraft / server directory or (in a singleplayer environment) in the main directory of a save. The file has to have this basic structure:
In the general section there is currently only one property you can set which is "initialSpawnDimension". This sets the dimension where a player who has never logged in before spawns initially.
This config would cause players to initially spawn in the nether when first joining the game.
The rules array can contain multiple rules which control the settings for different dimensions.
Each rule has these properties:
- appliesTo: An array containing either dimension ids / names of dimensions types / full class names of world providers. This controls what dimensions this rule is applied to. "*" can be used as a special element of appliesTo which will apply this rule to all dimensions.
- canRespawnHere: Whether players can respawn in the dimensions this rule applies to.
- canSleepHere: Whether players can sleep in the dimensions this rule applies to. (If canRespawnHere is set to false this has no effect). This also allows sleeping in dimensions where you generally can't sleep (Like the Nether / End).
- spawnPoint: The position at which players will spawn in this dimension.
- respawnDimension: The dimension players will respawn in when dying in this dimension (If canRespawnHere is set to false)
Rules that come later in the rules array override values of rules that come earlier.
Here are some examples:
This changes the initial spawn dimension & the respawn dimension of all dimensions to the nether. It also moves the spawn point of the nether to "x: 5, y: 84, z: 10" and allows players to change their spawn point in the nether by sleeping.
With this players will initially spawn in the end at "x: 23, y: 40, z: 10". Once they die they will respawn in the overworld at "x: 9, y: 100, z: 0". When they die there they will respawn in the nether at "x: 500, y: 40, z: -500". Dying in the nether will just respawn them back at "x: 500, y: 40, z: -500". It isn't possible to sleep in the nether / end / overworld.
Issues
Please post about bugs on the github issue tracker and not on the curseforge post. Also make sure your json is valid before creating a bug report.
Info for older versions ( < 1.12.2):
This mod allows map makers / server owners to set the exact spawn point of a world. You can also specify the start dimension.
To use this mod you place a file called PerfectSpawn.json in the main minecraft / server directory or (in a singleplayer environment) in the main directory of a save. The file has to have the following format:
{
"spawnDimension": 1,
"spawnX": 50,
"spawnY": 70,
"spawnZ": 60,
"exactSpawn": true,
"forceBed": true,
"spawnProtection": true
}
This config file sets the spawn point to X:50,Y:70,Z:60 in the end, enables beds, spawn protection and forces an exact spawn.
If you create a file you always have to specify spawnX,spawnY,spawnZ and spawnDimension. exactSpawn, spawnProtection and forceBed are optional and default to true.
- "exactSpawn" : Specifys whether players will respawn exactly at the specified spawn point.
- "forceBed": Specifys whether PerfectSpawn should force beds to be possible in the spawnDimension
- "spawnProtection" : Allows Spawn Protection in changed spawn dimensions.
A PerfectSpawn.json in a world directory overrides the one in the main dictionary.
You can use the command "/ps reload" to reload all config files and apply them instantly.
This mod class transforms all WorldProviders it finds, if you get a crash that only happens while using PerfectSpawn come to me first!
Instead of creating the json files manually you can also use the /ps set command to change the spawn ingame.
If you wanna add Perfect Spawn to a modpack / ship it with a map feel free to do so.
is it possible to create your own portal to dimensions with this mod?
Is it possible to have them spawn at random coordinates?
Hello! Using your mod and it is almost but not quite working as expected.
It is successfully making players respawn in the nether when they die in the nether, but despite setting a default spawn location, they respawn hundreds of blocks away... in midair over a lava lake. I assigned the respawn at 0, 34, 0. Actual respawn seems to be at -203, 40 (approximate), -32.
My json: https://pastebin.com/Wd6by27a
{
"general": {
"initialSpawnDimension": 111
},
"rules": [
"*"
{
"appliesTo": [
],
"canRespawnHere": true,
"canSleepHere": true,
"respawnDimension": 111
}
can anyone help me on why this won't work?
Just a note . . . using image files to show lines of text makes it really hard for users to employ online JSON editors to check their code . . . I had to go back and forth between the example tab and the editor tab rather than copy/paste followed by edits.
Im struggling to create a config. Can someone help me? When joining a world my game just crashes and yes the dimensions with id 44 and 45 exist in my pack
https://imgur.com/a/bk1EiTd
In reply to MCSuchter_YT:
Wow... now I fixed it - forgot two commas
Add the option to spawn the player on the highest block in a specific world. I want to start in a dimension but that dimension has very various y coordinates... Can't use this at all
In reply to MCSuchter_YT:
oh shit... nevermind just use "posY": 255 for the highest block...
In reply to MCSuchter_YT:
In reply to MCSuchter_YT:
Ok after testing it spawns me somewhere else...
Hey. Thank you for your work ! I love your mod.
I NEED copyable text for the CURRENT version.
Ok, we're still having to deal with the spawning of the player not being correct, I set the default spawn to be in dimension 10, what happens is I always spawn in one place that is either floating in the air or in solid blocks, there are no safe spawn mechanics whatsoever
In reply to UnlimatedStone9:
Just use "posY": 255
In reply to UnlimatedStone9:
In reply to UnlimatedStone9:
Ok sorry doesn't work really
Ok, This Is Driving Me Mental, When I Set The perfectspawn.json File With This Script I Can Successfully Spawn In The Dimension, However The World Is Above 120 Blocks Tall, This Means I Either Spawn In Caves Or Solid Blocks, Solutions?, The Mod Should Spawn PLayers At The Safest And Highest Point To Prevent Death, Instead What It Currently Does Is Spawn The Player At Vanilla Overworld Heights
{
"general": {
"initialSpawnDimension": 20
},
"rules": [
{
"appliesTo": [
"*"
],
"canRespawnHere": false,
"canSleepHere": false,
"respawnDimension": 20
},
{
"appliesTo": [
20
],
"canRespawnHere": true,
"respawnDimension": 20,
"spawnpoint": {
"posX": 0,
"posz": 0
}
}
]
}
In reply to UnlimatedStone9:
In reply to UnlimatedStone9:
In reply to jredfox:
I'm trying to setup a modpack that has the player traveling through dimensions, but never actually going to the overworld. I have the player starting in the Betweenlands dimension and can travel to other modded dimensions. This is all working as intended except that if the player dies outside of the Betweenlands (for example, the Nether) they end up respawning in the overworld. This happens despite having set /jed setworldspawn command in dim 20 and having used a bed to set the player spawn.
I'd like to do several things: