Code (Text):
Configuration file
All you need to know about the configuration file.
The plugin works as follows. When the player logs in, the plugin draws three random quests from the files. When the player logs out, the current quests are saved in a file. If the quests have been drawn for more than 24 hours, new ones replace them.
The plugin offers two modes:
Mode 1, which means that the quests will only come from the globalQuests.yml file.
Mode 2, which will give the player one quest per category file, i.e. an easy quest, a medium quest, and a hard quest.
You can select the mode you want, and change it at any time without changing the quest files.
However, if you change from one mode to another, we recommend that you delete the progress.yml file, because the next time the player logs in, it could generate errors, or the wrong quests could be loaded.
You can also change the names of the interfaces, the items to fill in the blanks, and the texts for the player menu.
For now, two storage methods are available : YAML and MySQL.
YAML : player progressions will be stored in a "progression.yml" file.
H2 : player progressions will be stored in a "database.mv.db" file.
MySQL : player progressions will be stored in a MySQL database. To configure, pleaser refer to the "database" section in the config.yml file.
The choice of storage only affects the progress of the players. Quests should always be created in the appropriate YAML files.
Please pay attention to the indentation on all YAML files. The slightest mismatch may cause errors when the plugin is loaded.
Also, you should never delete a variable, framed by percentages (%). These variables are used to display information such as quest names, rewards, number of items required...
This file supports HEX colour codes.
Anti-glitch
With the store_xx_xx options in the configuration file, you can prevent players from abusing quests, e.g. by breaking and placing the same block to make them progress.
Here is how it works:
Config. option Involved quest type Description
store_placed_blocks
BREAK
All blocks that have been placed by a player will not count in the quest progression.
store_broken_blocks
PLACE
All blocks that have been broken by a player will not count in the quest progression.
store_dropped_items
PICKUP
All items that have been dropped by a player will not count in the quest progression.
Warning: the options
store_broken_blocks
and
store_dropped_items
adds an NBT tag to the item dropped by the player. This means that its signature changes, and it will no longer be possible to stack them with unaffected items of the same type. However, these items are still normally usable.
The objects used are all stored using standard Spigot API objects: PersistentDataContainer and Metadata. This means that BattlePassQuest does not store anything itself, everything is managed by the server. So there shouldn't be any particular problems, except if the API changes from one version to another.
On the other hand, this kind of data is not saved after the server is restarted. But this will still limit abuse for the most part.
Custom types
Since the 2.3.0, it is possible to create custom quest types directly in the configuration file.
This kind of quest can be used with other plugins rewards or actions with the following command :
/bpa customcomplete <player> <type> <amount>
These quests can therefore only be progressed and completed via the command. This type of quest can be very useful if you need a type that doesn't already exist, linked to a plugin.
Let's take an example. You have a shop with rare items made with ShopGUI+, and one of your quests is to buy a Nether Star. In your BattlePassQuest configuration, you have the following block :
Copy
# ===========================================================
# CUSTOM QUESTS TYPES
# Here you can add custom quests types that can be complete only with command:
# /bpa customcomplete <player> <type> <amount>
# This kind of quest can be used with other plugins rewards or actions.
# ===========================================================
custom_types:
- "BUY_NETHER_STAR"
Then you have the following item in your ShopGUI+ configuration :
Copy
1:
type: command
item:
material: NETHER_STAR
quantity: 1
commands:
- "give %PLAYER% nether_star 1"
- "bpa customcomplete %PLAYER% BUY_NETHER_STAR 1"
requireInventorySpace: true
buyPrice: 100
slot: 0
And that's it! When the player buys a Nether Star, the command will be executed, and if the player has a quest of type BUY_NETHER_STAR, it will progress by 1. If the player doesn't have the quest, nothing happens, quite simply.
You can create as many types as you like, associating one per action. You can use them wherever the other plugin lets you run commands as a console: dungeons, quests, mini-games, events... You can even complete them manually during your hand-managed events.
Copy
# if the plugin doesn't work as expected, set debug to true and send the log file to the developer.
debug: false
# never touch this line
version: 2.3.0
# plugin prefix for messaging
prefix: "&7[BattlePassQuest&7]"
# disable the logs when player quests are saved
# NEVER ask for support with this option enabled
disable_logs: false
# storage mode for quests & progression
# AVAILABLE MODES: YAML, MySQL,H2
# RECOMMENDED: H2
storage_mode: "H2"
# MySQL Database Connection
database:
name: "MyDatabase" # Database name
host: "127.0.0.1" # Database host
user: "admin" # Database user
password: "1234" # Database password
port: "3306" # Database port
# Select the mode of the quests.
# ==========================================================
# 1 : only the global quests will be loaded.
# The player's quests will only come from there.
# ==========================================================
# 2 : easy, medium and hard quests will be loaded.
# One quest per difficulty will be assigned to the players.
# ==========================================================
# You need to reset progressions if you change this mode.
quests_mode: 1
# Select the amount of daily quests given to the player.
# Apply to quests mode 1 (global).
global_quests_amount: 3
# Select the amount of daily quests given to the player.
# Apply to quests mode 2 (categorized).
easy_quests_amount: 1
medium_quests_amount: 1
hard_quests_amount: 1
# Select the mode of timestamp.
# ============================================================================
# 1 : quests will be reloaded at midnight for all players.
# ============================================================================
# 2 : player quests will be reloaded if active quests are older
# than the duration selected temporality mode.
# This means that each player will have new quests at a different login time.
# ============================================================================
# The timestamp depends on the machine on which your server is installed.
# Set the right time zone!
# ============================================================================
# You need to reset progressions if you change this mode.
timestamp_mode: 1
# Select the mode of temporality.
# ===================================
# 1 : daily quests.
# ===================================
# 2 : weekly quests.
# ===================================
# 3 : monthly quests.
# ===================================
# You need to reset progressions
# if you change this mode.
temporality_mode: 1
# Initials that will be displayed
# between the values on the placeholders.
# ex: 6d9h24m
temporality_initials:
days: "d"
hours: "h"
minutes: "m"
few_seconds: "Few seconds"
# Global Reward
# Will be given when the player has completed all his daily quests.
# The syntax is the same as for quest rewards.
global_reward:
enabled: true
reward_type: COMMAND
commands:
- "eco give %player% 5000"
- "give %player% diamond_block 32"
# Categories Rewards
# Will be given when the player has completed all his daily quests of a precise category.
# The syntax is the same as for quest rewards, and the global reward.
# Will be by default disabled if the quests mode is set to 1.
categories_rewards:
easy:
enabled: true
reward_type: COMMAND
commands:
- "eco give %player% 1000"
- "give %player% diamond_block 16"
medium:
enabled: true
reward_type: COMMAND
commands:
- "eco give %player% 2000"
- "give %player% diamond_block 32"
hard:
enabled: true
reward_type: COMMAND
commands:
- "eco give %player% 3000"
- "give %player% diamond_block 64"
# If a player has two quests of the same type and with the same item/entity,
# choose if they should progress simultaneously
# or if the first should be completed before the second progresses.
synchronised_progression: false
# Set a title that will be displayed when a player completes a quest.
# Reminder: 20 ticks is equal to one second.
# Available placeholders : %player% , %questName%
title:
enabled: true
fadeIn: 10 # The default number of ticks for the title to fade in.
stay: 70 # The default number of ticks for the title to stay.
fadeOut: 20 # The default number of ticks for the title to fade out.
text: "&aWell done, %player%"
subtitle: "&aYou have completed the quest %questName% &a!" # Leave this field blank if you do not want a subtitle
# Set a message that will be displayed in the actionbar when a player completes a quest.
# Available placeholders : %player% , %questName%
actionbar:
enabled: true
text: "&eYou have completed the quest %questName%&e!"
# Set a message that will be displayed to the player when he progresses in a quest.
# Available placeholders : %player% , %questName% , %progressBar% , %progress% , %required%
# Available types : ACTIONBAR, BOSSBAR, CHAT
# /!\ The CHAT type is not recommended, it can cause chat spam.
progression_message:
enabled: true
text: "%progressBar% &7(&b%progress%&a/&b%required% &7- &e%questName%&7)"
type: BOSSBAR
bossbar: # only apply if type is set to BOSSBAR
color: PURPLE # https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/boss/BarColor.html
style: SEGMENTED_6 # https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/boss/BarStyle.html
# Here you can customize the progress bar that can be used with the %progressBar% placeholder.
# symbol: the symbol that will be used to fill the progress bar.
# amount_of_symbols: the number of symbols that will be used.
# completed_color: the color of the symbols for the progress made.
# remaining_color: the color of the symbols for the progress to be achieved.
progress_bar:
symbol: "|"
amount_of_symbols: 20
completed_color: "&a"
remaining_color: "&7"
# Disables the progression of quests where you have to kill an entity if it comes from a Spawner.
disable_spawners_progression: false
# Determines if the player loses required items when completing a GET quest.
take_items_for_get_quests: false
# Determines if the quest can be rerolled even if it has already been completed, when using the reroll command.
reroll_only_if_not_achieved: true
# ===========================================================
# ANTI-GLITCH PART
# Here you can prevent some abuse from players, by storing the items they have used.
# ===========================================================
# All blocks that have been placed by a player will not count towards the progress of a BREAK quest.
store_placed_blocks: true
# All blocks that have been broken by a player will not count towards the progress of a PLACE quest.
#
# Warning: this option adds an NBT tag to the item(s) dropped by the block.
# This means that its signature changes, and it will no longer be possible to stack them with unaffected items of the same type.
# However, these items are still normally usable.
store_broken_blocks: false
# All items dropped by a player will not count towards the progress of a PICKUP quest.
#
# Warning: this option adds an NBT tag to the item dropped by the player.
# This means that its signature changes, and it will no longer be possible to stack them with unaffected items of the same type.
# However, these items are still normally usable.
store_dropped_items: false
# ===========================================================
# CUSTOM ITEMS SUPPORT
# ===========================================================
# Enable this if you are using IA items for quest menu or required items.
# NEVER enable this if you are NOT using ItemsAdder. The quests will not load.
use_itemsadder: false
# Enable this if you are using Oraxen items for quest menu or required items.
# NEVER enable this if you are NOT using Oraxen. The quests will not load.
use_oraxen: false
# Enable this if some plugins are modifying the furnace results.
# You should enable it if the furnace results can have a custom model data (e.g. with Oraxen).
# Enabled by default if you are using ItemsAdder.
use_custom_furnace_results: false
# ===========================================================
# CUSTOM QUESTS TYPES
# Here you can add custom quests types that can be complete only with command:
# /dqa customcomplete <player> <type> <amount>
# This kind of quest can be used with other plugins rewards or actions.
# More information on the Wiki.
# ===========================================================
custom_types:
- "COMPLETE_DUNGEON"
- "KILL_BOSS"
- "BUY_VIP"
# ===========================================================
# interfaces settings
interfaces:
next_item_name: "&a&lNext Page"
previous_item_name: "&e&lPrevious Page"
global_quests:
inventory_name: "Quests - Global"
empty_item: BLACK_STAINED_GLASS_PANE
easy_quests:
inventory_name: "Quests - Easy"
empty_item: GREEN_STAINED_GLASS_PANE
medium_quests:
inventory_name: "Quests - Medium"
empty_item: YELLOW_STAINED_GLASS_PANE
hard_quests:
inventory_name: "Quests - Hard"
empty_item: RED_STAINED_GLASS_PANE
# You can disable quest progression in certain worlds.
# You must put here the name of the world (in theory the name of its directory).
# If you don't want to disable worlds, just put a single line with no name (- "").
# In addition, you can disable some worlds for each quest. Please refer to the Wiki.
#
# You can also use prefixes/suffixes to disable multiple worlds at once with the "?" character.
# For example, "?_survival" will disable all worlds ending with "_survival".
disabled_worlds:
- "world_nether"
- "world_the_end"
# ===========================================================
# INTEGRATIONS - Functionalities related to other plugins
# ===========================================================
# Citizens Implementation
# Here you can select NPCs names for each category.
# The player have to interact with the NPC to open an interface.
npcs:
name_player: "&7Player Quests"
name_global: "&4Global Quests"
name_easy: "&a&lEasy &mQuests"
name_medium: "&e&lMedium &rQuests"
name_hard: "&cHard &b&lQuests"
# If you use WildStacker on your server to group mobs, set this parameter to "true".
use_wildstacker: false
# If you are using MythicMobs, you can set this parameter to "true" to share the mobs between players.
#
# It means that if someone kill a mob, the quest progression will be updated for all players
# that were involved in the fight and that have the quest.
shared_mobs: false