When adding flags to a player entity, you should prefix the flag name with the unique prefix of your module. For example, flags related to QLD Minecraft are prefixed with qm_
Below is a table of flags that QLD Minecraft uses for players that can be used by modules:
If the player is a developer
Country code of the player language localization
The top most region the player resides in by priority
A map of regions the player currently resides in by cuboid. The key is the region ID while the value is the priority
A list of biomes associated with a region within the player flag qm_region_list. Only regions within the player flag
qm_region_list are expected to be present
Last location player died
Determine if player is in developer mode:
Override player place block in a region that typically denies:
on player places block priority:-1:- flag player qm_override.block_place:true
Modules are allowed to store data inside the players YAML data file provided that they contain their data under a single key that is named appropriately. This YAML file is available while the player is online and can be loaded/unloaded when the player is offline by the use of tasks. The YAML identifier is qm_<player_uuid>
# Reading the player data key 'trait_vendor' of the current player- define value:<yaml[qm_<player.uuid>].read[trait_vendor]>
When you require to load a player data file when a player is offline, you can use the
qldminecraft.player.yaml.load task with a player item as the definition. The data file will remain in RAM until you either use the
qldminecraft.player.yaml.unload task or the player logs in and logs out.
If the player logs in after you load a player data file, or the data file is already loaded, the data file will not be reloaded.
Player data files loaded while the player is offline will not be periodically saved by the server as per online players.
# Loading the player data file for nomadjimbob- run qldminecraft.player.yaml.load def:<server.match_player[nomadjimbob]>
You can use the task
qldminecraft.player.yaml.save with a player item as its definition to save a player data file. Modules are only required to perform this they load a player data file manually and the player is offline, else player data will be saved peridically by the server, or when the player logs out.
# Saving a player data file- run qldminecraft.player.yaml.save def:<server.match_player[nomadjimbob]>
When a module is finished with a player data file, it can be unloaded using the qldminecraft.player.yaml.unload task with a player item as its definition. The unload data task does not save the file before unloading it from memory.
Modules should not unload player data if the player is online as this can cause issues for the players current session.
# Unloading a player data file- run qldminecraft.player.yaml.unload def:<server.match_player[nomadjimbob]>