QuestCreator - Create your first quest

Apr 1, 2017
QuestCreator - Create your first quest
  • [​IMG]

    Table of contents :

    1. Commands and permissions
    2. Plugin storage system and configuration
    3. Create your first quest : settings, actions and tasks
    4. Variables system
    5. Advanced quest configuration
    6. NPCs
    7. Runnable jar GUI and developers API


    3. Create your first quest : settings, actions and tasks

    First of all, create a file in the /quests/ directory. The file name (without the extension) will be the quest id, so don't put spaces in it.

    Let's analyse this example quest, which is generated by default.

    Code (Text):
    #----------------------------------------------------------------------------------------------------
    # Quest 'example' (file name without the extension is the quest identifier)
    # You can use the configuration to configure the quest yourself, but it is recommended to use
    #  the software (QuestCreator.jar) to create the quests !
    #----------------------------------------------------------------------------------------------------
    # This is a Pyr Markup Language file (.pyrml). It's a brand new markup language system which is
    # similar but simpler than YML. Tutorial : https://www.spigotmc.org/wiki/pyrml-tutorial/
    #----------------------------------------------------------------------------------------------------

    # Quest display

    display=
      name=Example
      infos=/
        &7This quest is the example quest, which is available in the GUI.
        &7You can follow it with a simple right click.
        &7Good luck !

    # Quest settings

    settings=
      available_in_gui=true
      max_players_in_same_time=1
      allowed_levels=1,2# The allowed levels, if "levelling.enable" is "true" in config.pyrml
      max_players_coop=1# If this is set to 4 for example, then 5 players will be able to do the quest in coop. To disable this option, set it to -1.

    # Requirements needed to start the quest
    # For each requirement, the different settings are separed by the ; character.
    # You can add different requirements :
    #  - money;{amount} (handled with Vault)
    #  - permission;{permission}
    #  - item;{amount},{id},{data} (unnamed item)
    #  - item;{amount},{name} (named item)
    #  - -var: {variable} is {value}

    requirements=//

    # Rewards
    # For each reward, the different settings are separed by the ; character.
    # You can add different rewards :
    #  - money;{amount} (handled with Vault)
    #  - xp;{amount} (minecraft xp)
    #  - levelling_xp;{amount} (levelling xp)
    #  - command;{command}
    #  - item;{amount},{id},{data} (unnamed item)
    #  - item;{amount},{id},{data},{name} (named item)
    #  - -var: {variable} set {value}
    #  - -var: {variable} increment {increment amount} (if the variable is integer)

    rewards=/
      money;15
      xp;100
      levelling_xp;30
      command;say {player} won !
      item;64,3,0
      item;64,1,0,&aAwesome stone !

    # GUI items settings (if "available_in_gui" in "settings" is set to "true")

    gui_item_available=
      data=28,0
      name=&2Example
      lore=/
        &aDiscover the first quest !
        &7Right click to follow this quest
        &7Left click to see more informations

    gui_item_completed=
      data=28,0
      name=&7Example
      lore=/
        &7Discover the first quest !
        &7You already completed this quest.

    #----------------------------------------------------------------------------------------------------
    # Actions
    #----------------------------------------------------------------------------------------------------

    actions=

      # Action 1

      action_1=
        # Tasks before the action
        tasks_before=
          1=
            delay=1
            type=CLEAR_PLAYER
          2=
            type=SEND_MESSAGE
            message=&2[AI] &aHello, {player}&a. I'm here to ensure that your motor skills are functionnals.
          3=
            delay=30
            type=SEND_MESSAGE
            message=&2[AI] &aFirst of all, let's check your ability to walk. Please, &6{objective}&a.
        # Action data
        data=
          type=WALK
          name=Walk on 30 blocs
          distance=30.0
          forbidden_player_actions=//

      # Action 2

      action_2=
        # Tasks before the action
        tasks_before=
          1=
            type=SEND_MESSAGE
            message=&2[AI] &aGood job !
          2=
            delay=10
            type=CHOICE
            message=&2[AI] &aDo you want to execute the jump test ?
            choices=
              yes=/
                &bOf course !
                -var: example_want_jump set yes
              no=/
                &bNo, I don't.
                -var: example_want_jump set no
                -skip
          # If player accepted
          3=
            skip_if=/
              -var: example_want_jump is no
            type=SEND_MESSAGE
            message=&2[AI] &aOk, let's jump. I'll ask you to &6{objective}&a.
          # If player refused
          4=
            skip_if=/
              -var: example_want_jump is yes
            type=SEND_MESSAGE
            message=&2[AI] &aThat's fine, no problem !
        # Action data
        data=
          type=JUMP
          name=Jump 5 times
          times=5
          forbidden_player_actions=//

    #----------------------------------------------------------------------------------------------------
    # Tasks to execute on quest end
    #----------------------------------------------------------------------------------------------------

    tasks_after=
      1=
        skip_if=/
          -var: example_want_jump is no
        type=SEND_MESSAGE
        message=/
          &2[AI] &aGood job !
      2=
        type=SEND_MESSAGE
        message=/
          &2[AI] &aWell, everything seems fine. Well played, {player} &a!
     

    Everything you need to know is explained and commented above.

    Code (Text):
    # All the existing actions are here
    # (modifying this file will have no effect)
    # You need to put the sub section values (type, location or whatever) in the data section in the quest configuration file

    # The playst must click on a block

    action_click_block=
      type=CLICK_BLOCK
      location=world,0,0,0

    # The player must pickup X items (with specific type and/or data)

    action_pickup_item=
      type=PICKUP_ITEM
      amount=1
      item_type=DIRT# You can set it to an unexisting material to prevent same type check
      item_data=0# You can set it to -1 to prevent same data check

    # The player must drop X items (with specific type and/or data)

    action_drop_item=
      type=DROP_ITEM
      amount=1
      item_type=DIRT# You can set it to an unexisting material to prevent same type check
      item_data=0# You can set it to -1 to prevent same data check
      location=world,0,0,0# Delete this line to prevent location check.

    # The player must craft X items (with specific type and/or data)

    action_craft_item=
      type=CRAFT_ITEM
      amount=1
      item_type=DIAMOND_SWORD# You can set it to an unexisting material to prevent same type check
      item_data=0# You can set it to -1 to prevent same data check

    # The player must enchant X items (with specific type and/or data) with a specific enchant type

    action_enchant_item=
      type=ENCHANT_ITEM
      amount=1
      item_type=DIAMOND_SWORD# You can set it to an unexisting material to prevent same type check
      item_data=0# You can set it to -1 to prevent same data check
      enchant_type=DAMAGE_ALL
      enchant_min_level=1

    # The player must consume X items (with specific type and/or data)

    action_consume_item=
      type=CONSUME_ITEM
      amount=1
      item_type=APPLE# You can set it to an unexisting material to prevent same type check
      item_data=0# You can set it to -1 to prevent same data check

    # The player must walk on X blocks

    action_walk=
      type=WALK
      distance=30.0

    # The player must jump X times

    action_jump=
      type=JUMP
      times=5

    # The player must toggle sneak X times

    action_toggle_sneak=
      type=TOGGLE_SNEAK
      times=5

    # The player must sneak X seconds

    action_sneak=
      type=SNEAK
      seconds=5

    # The player must go somewhere

    action_walk_to=
      type=WALK_TO
      location=world,0,0,0
      allowed_distance=1.5# The maximum allowed distance difference (eg. if the player comes at 1.0 bloc from the location, the action will be completed)

    # The player must get away from somewhere

    action_walk_away_from=
      type=WALK_AWAY_FROM
      location=world,0,0,0
      distance=10.0

    # The player must create X blocs with FrostWalker enchanted boots

    action_frost_walker=
      type=FROST_WALKER
      amount=10

    # The player must enter a portal

    action_enter_portal=
      type=PORTAL_ENTER

    # The player must travel a portal

    action_travel_portal=
      type=PORTAL_TRAVEL

    # The player must place X blocs (with specific type and/or data)

    action_block_place=
      type=BLOCK_PLACE
      amount=1
      block_type=STONE# You can set it to an unexisting material to prevent same type check
      block_data=0# You can set it to -1 to prevent same data check

    # The player must place a block at a specific location

    action_block_place_at=
      type=BLOCK_PLACE_AT
      block_type=STONE# You can set it to an unexisting material to prevent same type check
      block_data=0# You can set it to -1 to prevent same data check
      location=world,0,0,0

    # The player must place X blocks in a specific zone

    action_block_place_zone=
      type=BLOCK_PLACE_ZONE
      block_type=STONE# You can set it to an unexisting material to prevent same type check
      block_data=0# You can set it to -1 to prevent same data check
      point_1=world,0,0,0
      point_2=world,10,10,10
      amount=10

    # The player must place X blocs (with specific type and/or data)

    action_block_break=
      type=BLOCK_BREAK
      amount=1
      block_type=STONE# You can set it to an unexisting material to prevent same type check
      block_data=0# You can set it to -1 to prevent same data check

    # The player must place a block at a specific location

    action_block_break_at=
      type=BLOCK_BREAK_AT
      location=world,0,0,0

    # The player must break X blocks in a specific zone

    action_block_break_zone=
      type=BLOCK_BREAK_ZONE
      block_type=STONE# You can set it to an unexisting material to prevent same type check
      block_data=0# You can set it to -1 to prevent same data check
      point_1=world,0,0,0
      point_2=world,10,10,10
      amount=10

    # The player must put X blocs (with specific type and/or data) in fire

    action_block_fire=
      type=BLOCK_FIRE
      amount=1
      block_type=STONE# You can set it to an unexisting material to prevent same type check
      block_data=0# You can set it to -1 to prevent same data check

    # The player must put a bloc in fire at a specific location

    action_block_fire_at=
      type=BLOCK_FIRE_AT
      location=world,0,0,0

    # The player must kill X mobs (with specific type)

    action_mob_kill=
      type=MOB_KILL
      amount=1
      mob_type=PIG# You can set it to an unexisting mob type to prevent the same type check

    # The player must kill X mobs with a specific name

    action_mob_kill_named=
      type=MOB_KILL_NAMED
      amount=1
      mob_name=&aMyCustomMob

    # The player must breed X entities (with a specific type)

    action_mob_breed=
      type=MOB_BREED
      amount=1
      mob_type=COW# You can set it to an unexisting mob type to prevent the same type check

    # The player must mount an entity (with a specific type)

    action_mob_mount=
      type=MOB_MOUNT
      mob_type=HORSE# You can set it to an unexisting mob type to prevent the same type check

    # The player must mount a mob with a specific name

    action_mob_mount_named=
      type=MOB_MOUNT_NAMED
      mob_name=&aMyCustomMount

    # The player must dismount an entity (with a specific type)

    action_mob_dismount=
      type=MOB_DISMOUNT
      mob_type=HORSE# You can set it to an unexisting mob type to prevent the same type check

    # The player must dismount a mob with a specific name

    action_mob_dismount_named=
      type=MOB_DISMOUNT_NAMED
      mob_name=&aMyCustomMount

    # The player must tame X mobs

    action_mob_tame=
      type=MOB_TAME
      amount=1
      mob_type=WOLF# You can set it to an unexisting mob type to prevent the same type check

    # The player must tame X mobs with a specific name

    action_mob_tame_named=
      type=MOB_TAME_NAMED
      amount=1
      mob_name=&aMyCustomTame

    # The player must execute a command

    action_execute_command=
      type=EXECUTE_COMMAND
      command=/spawn

    # The player must say something in the chat

    action_chat=
      type=CHAT
      message=I must say that in the chat# This is case unsensivite

    # The player must enable a button in a specific location

    action_enable_button=
      type=ENABLE_BUTTON
      location=world,0,0,0# Delete this line to prevent location check.

    # The player must toggle a lever

    action_toggle_lever=
      type=TOGGLE_LEVER
      location=world,0,0,0# Delete this line to prevent location check.

    # The player must enable a pressure plate

    action_enable_pressure_plate=
      type=ENABLE_PRESSURE_PLATE
      location=world,0,0,0# Delete this line to prevent location check.

    # The player must open a recipient

    action_open_chest=
      type=OPEN_RECIPIENT
      location=world,0,0,0# Delete this line to prevent location check.

    # The player must regain health

    action_regain_health=
      type=REGAIN_HEALTH
      end=20.0# At the end, the player must have this HP

    # The player must shoot a projectile

    action_shoot_projectile=
      type=SHOOT_PROJECTILE
      projectile_type=ARROW/EGG/SNOWBALL# You can set it to an unexisting projectile type to prevent the same type check
      location=world,0,0,0# Delete this line to prevent location check.

    # The player must land with an elytra

    action_elytra_land=
      type=ELYTRA_LAND
      location=world,0,0,0# Delete this line to prevent location check.

    # The player must jump X times with a horse

    action_horse_jump=
      type=HORSE_JUMP
      times=1

    # The player must launch X XP bottle

    action_xp_bottle=
      type=XP_BOTTLE
      amount=1
      location=world,0,0,0# Delete this line to prevent location check.

    # The player must throw X potions

    action_potion=
      type=THROW_POTION
      amount=1
      potion_type=FIRE_RESISTANCE# You can set it to an unexisting potion type to prevent the same type check
      location=world,0,0,0# Delete this line to prevent location check.

    # The player must earn an achievement

    action_achievement=
      type=ACHIEVEMENT
      achievement=BAKE_CAKE

    # The player must enter a bed

    action_bed_enter=
      type=BED_ENTER
      location=world,0,0,0# Delete this line to prevent location check.

    # The player must quit a bed

    action_bed_leave=
      type=BED_LEAVE
      location=world,0,0,0# Delete this line to prevent location check.

    # The player must fill a bucket

    action_fill_bucket=
      type=FILL_BUCKET
      bucket_type=LAVA/WATER/MILK# You can set it to an unexisting bucket type to prevent the same type check

    # The player must earn X XP

    action_xp=
      type=XP
      amount=1

    # The player must fish X fishes

    action_fish=
      type=FISH
      amount=1

    # The player must shear X sheeps

    action_shear=
      type=SHEAR
      amount=1

    # The player must shear X sheeps with a specific name

    action_shear_named=
      type=SHEAR_NAMED
      amount=1
      sheep_name=&aMyCustomSheep

    # The player must enter a vehicle

    action_vehicle_enter=
      type=VEHICLE_ENTER
      vehicle_type=MINECART# You can set it to an unexisting vehicle type to prevent the same type check

    # The player must exit a vehicle

    action_vehicle_leave=
      type=VEHICLE_EXIT
      vehicle_type=MINECART# You can set it to an unexisting vehicle type to prevent the same type check

    # The player must right click a NPC

    action_interact_npc=
      type=NPC_INTERACT
      id=test
     

    Code (Text):
    # All the existing tasks are here
    # (modifying this file will have no effect)

    # None (just for the delay)

    task_none=
      # The delay (in ticks) before the task is executed
      delay=0

    # Clear the player

    task_clear_player=
      delay=0
      type=CLEAR_PLAYER

    # Send a one-line message to the player

    task_send_message=
      delay=0
      type=SEND_MESSAGE
      message=&2Exemple message

    # Send a multi-lines message to the player

    task_send_message=
      delay=0
      type=SEND_MESSAGE
      message=/
        &2Exemple message
        &2... on two lines

    # --> For the SEND_MESSAGE task, you can also specify a sound after it, like SEND_MESSAGE:ENTITY_VILLAGER_TRADING

    # Send a title to the player
    # The times are in ticks

    task_send_title=
      delay=0
      type=SEND_TITLE
      title=
        fade_in=0
        duration=20
        fade_out=0
        title=&aTitle
        subtitle=&aSubtitle

    # Send an action bar to the player

    task_send_action_bar=
      delay=0
      type=SEND_ACTION_BAR
      bar=&aAction bar

    # Change the player's TAB

    task_change_tab=
      delay=0
      type=CHANGE_TAB
      tab=
        header='&aHeader'
        footer='&aFooter'

    # Teleport the player

    task_teleport=
      delay=0
      type=TELEPORT
      location=world,0,0,0 # The location (world,x,y,z)

    # Give an item to the player

    task_give_item=
      delay=0
      type=GIVE_ITEM
      item_type=DIRT
      item_data=0
      item_name='&aTHE dirt'
      item_lore=/
        &aThe lore

    # Delete an object from the player's inventory

    task_delete_item=
      delay=0
      type=DELETE_ITEM
      item_type=DIRT
      item_data=0
      item_name=&aTHE dirt
      item_lore=/
        &aThe lore

    # Give an achievement to the player

    task_give_achievement=
      delay=0
      type=ACHIEVEMENT
      achievement=BAKE_CAKE

    # Spawn an entity somewhere

    task_spawn_entity=
      delay=0
      type=SPAWN_ENTITY
      entity_type=PIG
      entity_name=&aMy Pig# Delete this line to spawn a normal entity
      location=world,0,0,0

    # Spawn particles somewhere

    task_particles=
      delay=0
      type=SPAWN_PARTICLES
      particle_type=FLAME
      amount=1
      location=world,0,0,0

    # Execute a command (as the player)

    task_command_as=
      delay=0
      type=COMMAND_AS
      command=/me I''m {player}

    # Execute a command (for the player)

    task_command_for=
      delay=0
      type=COMMAND_FOR
      command=/spawn {player}

    # Place a block somewhere

    task_block_place=
      delay=0
      type=BLOCK_PLACE
      block_type=DIRT
      block_data=0
      location=world,0,0,0

    # Drop an item somewhere

    task_item_drop=
      delay=0
      type=ITEM_DROP
      item_type=DIRT
      item_data=0
      item_name=&aTHE dirt
      item_lore=/
        &aThe lore
      location=world,0,0,0

    # Create an explosion somewhere
    # Power 4 is the default value (TNT level)

    task_explosion=
      delay=0
      type=EXPLOSION
      power=4
      location=world,0,0,0

    # Damage the player

    task_damage=
      delay=0
      type=DAMAGE_PLAYER
      amount=2.0# 2 = 1 heart

    # Play a sound to the player

    task_sound=
      delay=0
      type=SOUND
      sound=AMBIANT_CAVE

    # Delete all entities with type X in a Y blocks radius around a location

    task_delete_entities=
      delay=0
      type=DELETE_ENTITIES
      entity_type=PIG
      location=world,0,0,0
      radius=2.0

    # Teleport named entities somewhere

    task_teleport_entities=
      delay=0
      type=TELEPORT_NAMED_ENTITIES
      entity_name=&aMustTeleported
      location=world,0,0,0

    # Assign a variable to a value (for the player)

    task_var_assign=
      delay=0
      type=VAR_ASSIGN
      var=var_name
      value=new value

    # Propose a choice to a player

    task_choice=
      delay=0
      type=CHOICE
      message=&aDo you want to do that ?
      # For each choice, the first line is the choice message and the other lines
      # are the eventual variables that you can change. You can skip the action with -skip
      choices=
        1=/
          &bOf course !
          -var: want_to_do_that set yes
        2=/
          &bNo, I don't.
          -var: want_to_do_that set no
          -skip

    # Teleport a NPC
    # The NPC must be registered in config.pyrml

    task_npc_teleport=
      delay=0
      type=NPC_TELEPORT
      id=test
      location=world,0,0,0

    # Make a NPC move
    # The NPC must be registered in config.pyrml

    task_npc_move=
      delay=0
      type=NPC_MOVE
      id=test
      location=world,0,0,0

    # Make a NPC move and wait for the end (the next tasks/actions won't start until the NPC is at the desired location)
    # The NPC must be registered in config.pyrml

    task_npc_move_wait=
      delay=0
      type=NPC_MOVE_WAIT
      id=test
      location=world,0,0,0

    # Hide a NPC
    # The NPC must be registered in config.pyrml

    task_npc_hide=
      delay=0
      type=NPC_HIDE
      id=test

    # Show a NPC
    # The NPC must be registered in config.pyrml

    task_npc_show=
      delay=0
      type=NPC_SHOW
      id=test
     

    Code (Text):
    # All the existing forbidden player actions are here
    # (modifying this file will have no effect)

    forbidden_player_actions=/
      MOVE
      PICKUP_ITEM
      DROP_ITEM
      CRAFT_ITEM
      ENCHANT_ITEM
      CONSUME_ITEM
      PORTAL
      PLACE_BLOCK
      BREAK_BLOCK
      BREED_ENTITY
      MOUNT_ENTITY
      TAME_ENTITY
      COMMAND
      CHAT
      INTERACT
      ENTER_BED
      FISH
      SHEAR_ENTITY
      ENTER_VEHICLE
      EXIT_VEHICLE
     

    See more details about the advanced configurations in parts 4 and 5 of the wiki.
  • Loading...
  • Loading...