OVERVIEW:
Data Packs that are applied to a world, before creation, and change, on initial world load, the default gamemode to adventure and also change the default gamerule for spawn chunk radius to 0, cause players to spawn in the world at Y=-63.
DATA PACK CODE:
defaultgamemode adventure
gamerule spawnChunkRadius 0
Steps to Reproduce (Part 1):
Download provided data pack ‘load_default_gamemode_and_spawn_chunk_radius_change.zip'
Load ‘Minecraft version 1.21.5’
Select 'Single Player'
Select ‘More'
Select ‘Data Packs'
Add the downloaded data pack, ‘load_default_gamemode_and_spawn_chunk_radius_change', to the ‘Select Data Packs’ ‘Available’ side.
At the prompt, ‘Do you wan to add the following packs to Minecraft? load_default_gamemode_and_spawn_chunk_radius_change' select ‘Yes’
Select the large ‘right arrow/play’ button ontop of the ‘load_default_gamemode_and_…’ data pack, under the ‘Available’ side of the ‘Select Data Packs' screen.
Select ‘Done’
Select ‘Create New World’ from the ‘More’ screen.
Wait for world to generate.
Press ‘F3’ to view current coordinates in game.
A video of the above instructions can be found attached, minus the downloading and unzipping of the datapack.
Steps to Reproduce (Part2)
In the downloaded, and unzipped data pack, ‘‘load_default_gamemode_and_spawn_chunk_radius_change.zip', open the file data>namespace_folder>function>default_gamemode_and_spawn_chunk_radius_change.mcfunction’
Change the first line from ‘defaultgamemode adventure’ to ‘#defaultgamemode adventure’.
Save the file ‘default_gamemode_and_spawn_chunk_radius_change.mcfunction’
Repeat the steps found in 'Steps to Reproduce (Part 1) to create a new world with the now edited downloaded data pack.
Note the lack of abnormal results (results different than those produced in ‘Steps to Reproduce (Part 1)’)
Steps to Reproduce (Part 3)
Repeat the steps found in ‘Steps to Reproduce (Part 2)’ but this time, instead of editing the first line ‘defaultgamemode adventure’, (as found in Step 2 of ‘Steps to Reproduce (Part 2)’) edit the second line from ‘gamerule spawnChunkRadius 0’ to '#gamerule spawnChunkRadius 0’.
Note the lack of abnormal results (results different from those produced in ‘Steps to Reproduce (Part 1)’, but the same results as those observed from ‘Steps to Reproduce (Part 2)’)
Additional notes on detection and identification:
This issue was found when a data pack changed all possible game rules, and game modes on the initial ‘load’ execution. Systematically, each command was removed from the function in question until the results changed. Specifically results were determined as being only dependent on the default game mode changing to adventure and spawn chunk radius being changed to 0. Further experimentation showed that changing to ‘creative’ mode in the same fashion didn’t produce the same results.
Thank you for your time, and …over a decade of improvements.
Environment
Windows 10 (Using Windows Classic Theme)
Java 21.0.3
Attachments
Comments 3
Due to the removal of the spawnChunkRadius
game rule, the command for changing the game rule must be commented in order for the data pack to work correctly:
defaultgamemode adventure
# gamerule spawnChunkRadius 0
As a result, the bug is no longer reproducible, and the player spawns at the correct location:
[media]This ticket can be resolved now.
Zipped datapack correctly to not require unzipping it:
[media]