Skip to main content
The MissionsManager handles all mission-related operations including retrieving missions, checking completion status, and rewarding players.

Methods

getMission

Mission<?> getMission(String name)
Get a mission by its name.
name
String
required
The name to check
return
Mission<?>
The mission instance or null if not found

getAllMissions

List<Mission<?>> getAllMissions()
Get a list of all the missions.
return
List<Mission<?>>
List of all missions

getPlayerMissions

List<Mission<?>> getPlayerMissions()
Get a list of all missions that are player missions.
return
List<Mission<?>>
List of all player missions

getIslandMissions

List<Mission<?>> getIslandMissions()
Get a list of all missions that are island missions.
return
List<Mission<?>>
List of all island missions

Mission Categories

getMissionCategory

MissionCategory getMissionCategory(String name)
Get a mission category by its name.
name
String
required
The name to check
return
MissionCategory
The mission category or null if not found

getMissionCategories

List<MissionCategory> getMissionCategories()
Get all the mission categories.
return
List<MissionCategory>
List of all mission categories

Mission Completion Checks

hasCompleted

boolean hasCompleted(SuperiorPlayer superiorPlayer, Mission<?> mission)
Check whether or not the player has already completed the mission.
superiorPlayer
SuperiorPlayer
required
The player to check
mission
Mission<?>
required
The mission to check
return
boolean
True if player has completed, otherwise false

canComplete

boolean canComplete(SuperiorPlayer superiorPlayer, Mission<?> mission)
Check whether or not a player can complete a mission.
superiorPlayer
SuperiorPlayer
required
The player to check
mission
Mission<?>
required
The mission to check
return
boolean
True if player can complete, otherwise false

canCompleteNoProgress

boolean canCompleteNoProgress(SuperiorPlayer superiorPlayer, Mission<?> mission)
Check whether or not a player can complete a mission, without considering progress.
superiorPlayer
SuperiorPlayer
required
The player to check
mission
Mission<?>
required
The mission to check
return
boolean
True if player can complete, otherwise false

canCompleteAgain

boolean canCompleteAgain(SuperiorPlayer superiorPlayer, Mission<?> mission)
Check whether or not the player can complete the mission again.
superiorPlayer
SuperiorPlayer
required
The player to check
mission
Mission<?>
required
The mission to check
return
boolean
True if player can complete again, otherwise false

hasAllRequiredMissions

boolean hasAllRequiredMissions(SuperiorPlayer superiorPlayer, Mission<?> mission)
Check whether or not a player has all the required missions to complete a mission.
superiorPlayer
SuperiorPlayer
required
The player to check
mission
Mission<?>
required
The mission to check
return
boolean
True if player has all required missions, otherwise false

canPassAllChecks

boolean canPassAllChecks(SuperiorPlayer superiorPlayer, Mission<?> mission)
Check whether or not a player can pass all the checks to complete a mission.
superiorPlayer
SuperiorPlayer
required
The player to check
mission
Mission<?>
required
The mission to check
return
boolean
True if player can pass all checks, otherwise false

Mission Rewards

rewardMission

void rewardMission(Mission<?> mission, SuperiorPlayer superiorPlayer, boolean checkAutoReward)
void rewardMission(Mission<?> mission, SuperiorPlayer superiorPlayer, boolean checkAutoReward, boolean forceReward)
void rewardMission(Mission<?> mission, SuperiorPlayer superiorPlayer, boolean checkAutoReward, boolean forceReward, @Nullable Consumer<Boolean> result)
Reward a player for completing a specific mission.
mission
Mission<?>
required
The mission that was completed
superiorPlayer
SuperiorPlayer
required
The player to reward
checkAutoReward
boolean
required
Whether or not the auto reward flag should be checked
forceReward
boolean
Should the plugin force the reward to the player (no checks will be ran)
result
Consumer<Boolean>
The result of the reward (nullable)

Data Management

saveMissionsData

void saveMissionsData()
Save all data related to missions. All the data is saved into a yaml file.

loadMissionsData

void loadMissionsData()
void loadMissionsData(List<Mission<?>> missionsList)
Load all data related to missions. All the data is loaded from a yaml file.
missionsList
List<Mission<?>>
Load data for specific missions only (optional)