This page relates to GameStages , which has built-in support!
When GameStages is installed you will be able to access the stage data of a player in your scripts. This can be done any time you have access to a player in your scripts, for example inside a player event listener.
These are all of the new player methods added by GameStages.
Any time you have access to a player you can add a stage using the following method.
// player.addGameStage(String stageName);
player . addGameStage( "stage_one" );
Any time you have access to a player you can remove a stage using the following method.
// player.removeGameStage(String stageName);
player . removeGameStage( "stage_one" );
You can also clear all stages granted to a player using the clear method.
player . clearGameStages ( ) ;
Any time you have access to a player you can check if they have a specific stage.
//player.hasGameStage(String stageName);
player . hasGameStage( "stage_one" );
You can also check if the player has any stage from an array of potential stages.
//player.hasAnyGameStages(String... stageNames);
player . hasAnyGameStages( "stage_one" , "stage_two" , "defeated_boss_a" );
var validStagesForX as string [] = [ "stage_one" , "stage_two" , "defeated_boss_a" ];
player . hasAnyGameStages(validStagesForX);
You can also check if the player has all of the stages from an array.
//player.hasllGameStages(String... stageNames);
player . hasAllGameStages( "stage_one" , "stage_two" , "defeated_boss_a" );
var requiredStagesForX as string [] = [ "stage_one" , "stage_two" , "defeated_boss_a" ];
player . hasAllGameStages(requiredStagesForX);
This example registers a new event listener that will will give a player a stage when they join the game if they haven’t already unlocked it.
import crafttweaker . api.events . CTEventManager;
import crafttweaker . api.event.entity.player . MCPlayerLoggedInEvent;
// Registers an event listener for the MCPlayerLoggedInEvent.
CTEventManager . register < MCPlayerLoggedInEvent>((event) => {
// The code in here will be ran every time any player loggs in.
// Gets the player from the event context.
var player = event . player;
// Only give the stage to the player if they don't have it already. This
// is not required but it is considered best practice.
if (! player . hasGameStage( "one" )) {
// Gives the stage "one" to the player.
player . addGameStage( "one" );
// Tell the player they unlocked a stage.
player . sendMessage( "You logged in! Here is stage 'one'." );