FANDOM


This page is in development. You are encouraged to provide feedback during the creation of this standard in the comments or in the #technical chat of the Gamemode 4 Discord https://discord.gg/5jAF2Ub

About Edit

Advancements are a new way of running commands in Minecraft using advancement files saved with the world instead of command blocks. This page outlines the standard format a Gamemode 4 module designed for advancements should follow. A standard will help users collaborate and reduce confusion during updating and installing for users of the system.

Folder Structure Edit

Gamemode 4 advancement files should go inside the "gm4" namespace within their own folder. For example, Bat Grenades would go in the file path data/advancements/gm4/bat_grenades/. The folder should be a lowercase version of the module name with underscores for spaces. This is because Minecraft has historically suddenly refused to deal with capitalisations in resource packs; something we should prepare for.

Master Clock folder Edit

Each module is supplied with a copy of the master_clock folder which players can drop into the advancements/gm4/ folder with the main module. It'll create the folder and files if they're not there, or overwrite them if they are.

The details of the master clock's behaviour and how other modules access it is yet to be decided. Discussion welcome.

Files Edit

init.json Edit

The init file should be an initialisation file. It contains scoreboard declarations and other setup commands that don't need to be run frequently. This advancement file will run once every time a player joins.

The init file will also check whether it is being run for the first time and print a successful installation tellraw to players the first time it runs. The GM4_stats scoreboard may be used for SuccessCount stats.

{
	"criteria":{
		"main":{
			"trigger":"minecraft:arbitrary_player_tick"
		}
	},
	"comment":"",
	"rewards":{
		"commands":[
			"scoreboard objectives add GM4_stats dummy",
			"stats entity @a set SuccessCount @s GM4_stats",
			"scoreboard players add @a GM4_stats 0",
			"scoreboard players add check GM4_batDeath 0",
			"execute @p[score_GM4_stats=0] ~ ~ ~ /tellraw @a [\"\",{\"text\":\"[GM4] \",\"color\":\"aqua\"},{\"text\":\"Bat Grenades Installed\",\"color\":\"none\"}]",
			"scoreboard objectives add GM4_batDeath dummy",
			"say any_other_init_commands_here"
		]
	}
}

This tries to add a fake "check" user to a scoreboard the module uses (in this case GM4_batDeath). If it fails you know this is the first time init has been run. Stats are used to detect the failure and print an installation message. Any other initialisation such as declaring scoreboards and setting default values are then added.

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.