Creating Your Own Quest Types
With BattlePass v4, creating your own quest types is quick and simple but there are still a few steps.
1) Make sure you depend on BattlePass (or soft depend). If you're soft depending, remember to check if the plugin is enabled.
2) Make a class for your quest and have it extend ExternalActionContainer
. Use your IDE to automatically implement the required constructor.
3) Do whatever you wish and use the execute method to actually trigger the event with all the values with wish.
Use this example to explain the rest (most should be explained just by viewing available inputs anyway):
Don't forget to change your_plugin_name
and quest_name
**This example will create quest with type your_plugin_name_quest_name
**
4) Now you need to actually register the quest. To do this, you first need to get the quest registry as such:
5) Now, you can use the quest
method to register the quest. If it depends on an external plugin, use the hook
method (checks if the plugin is enabled).
Internal:
External:
Useful ActionExecutionBuilder
methods
ActionExecutionBuilder
methodsplayer(Player player)
- Set playeroverrideUpdate()
- Set progress to override entire progresscanBeAsync()
- Execute asynchronously (don't use when root/subroot uses blocks,items or entities)
root(String root)
- Set root to stringroot(Block root)
- Set root to blockroot(ItemStack root)
- Set root to itemstackroot(Entity root)
- Set root to entityroot(Material root)
- Set root to materialroot(Predicate<Object> root)
- Manually create root checking method which takes String, ItemStack, Entity or Material as parameter and returns true if root is correct or false.
subRoot(String key, String value)
- Add subroot with stringsubRoot(String key, Material value)
- Add subroot with materialsubRoot(String key, ItemStack value)
- Add subroot with itemstacksubRoot(String key, Block value)
- Add subroot with blocksubRoot(String key, Entity value)
- Add subroot with entitysubRoot(String key, Predicate<Object> value)
- Manually create subroot checking method which takes String, ItemStack, Entity or Material as parameter and returns true if root is correct or false.subRoot(ItemStack itemStack)
- Additem
subroot with itemstack
progressSingle()
- Add 1 progressprogress(BigInteger progress)
- Add progressprogress(int progress)
- Add progressprogress(double progress)
- Add progress
Last updated