On First World Load
Introduction
Sourced by the Bedrock Commands Community (BCC) Discord
This system allows you to run specific commands the very first time a world is loaded after your pack has been applied.
Note: A Function Pack is required for this system. The
tick.jsonfile is necessary to trigger the logic as soon as the world initializes.
Tick JSON
{
"values": [
"wiki/main"
]
}Main MCFUNCTION
# ON FIRST WORLD LOAD
## Execute Function if World Not Initialized
execute unless score .World wiki:q.is_initialised matches 1 run function wiki/event/worlds/on_initialiseSystem
## Your Commands Here (Example)
say World initialized! Pack loaded for the first time.
## Initialization
### Add objective
scoreboard objectives add wiki:q.is_initialised dummy
### Mark as Initialized
scoreboard players set .World wiki:q.is_initialised 1Once your desired commands have been executed, the system creates a scoreboard objective titled wiki:q.is_initialised. This objective tracks the world's initialization state via a specific score holder named .World. By immediately setting the score for .World to 1, the system ensures the initialization logic is "locked," preventing it from re-running during subsequent ticks or world reloads.
Folder Structure
- main.mcfunction
- on_initialise.mcfunction
- tick.json
- pack_icon.png
- manifest.json
In this setup, the on_initialise function is called by main.mcfunction, which is executed every tick via tick.json.



