創建任務
範例任務
EliteMobs 預先包含了一個 test_quest.yml,這裡將分析它作為簡單任務格式的範例。
自訂任務位於 ~plugins/EliteMobs/customquests 資料夾中!
test_quest.yml
isEnabled: true
customObjectives:
Objective1:
amount: '1'
filename: test_boss.yml
objectiveType: KILL_CUSTOM
customRewards:
- filename=magmaguys_toothpick.yml:amount=1:chance=1
name: "&aKill the Test Boss"
questLore:
- "&cEnd the test boss'' reign of terror!"

如果您的任務介面看起來不像這樣,您可以使用 /em alt 來更改它。
這個範例任務將給予玩家擊殺 1 個 test_boss.yml 的任務。(在任務追蹤器中顯示的實際首領名稱將是在 test_boss.yml 中設定的 name:。)作為完成任務的獎勵,他們將獲得 1 個 Magmaguy's Toothpick。
創建自訂任務
customObjectives
設定任務目標。
| 鍵 | 值 | 預設 |
|---|---|---|
customObjectives | Special [1] | none |
注意:如果您使用多階段首領作為目標,則目標應使用第一階段作為目標。
範例
KILL_CUSTOM:
customObjectives:
Objective1:
amount: '1'
filename: my_cool_boss.yml
objectiveType: KILL_CUSTOM
DIALOG:
customObjectives:
Objective1:
dialog:
- "&a[Dialog NPC] &fCome here often?"
- "&7&oI should eat more apples."
filename: dialog_npc.yml
npcName: Dialog NPC
location: at dialog location.
objectiveType: DIALOG
FETCH_ITEM:
customObjectives:
Objective1:
amount: '99'
itemName: Red Apples
filename: my_quest_item_red_apples.yml
objectiveType: FETCH_ITEM
ARENA:
customObjectives:
Objective1:
objectiveType: ARENA
filename: my_arena.yml
name: "Complete the Arena"

Special [1]
展開表格
自訂目標使用以下值構建:
| 鍵 | 說明 |
|---|---|
KILL_CUSTOM / FETCH_ITEM / DIALOG / ARENA | 用於設定此目標代表的類型。KILL_CUSTOM 表示任務涉及擊殺特定的 Custom Boss,FETCH_ITEM 表示任務涉及獲取特定的 Custom Item,DIALOG 表示任務涉及與 NPC 對話,ARENA 表示任務涉及完成特定的競技場。 |
filename | 用於設定 Custom Boss 的檔案名稱、玩家必須擊殺/獲得的 Custom Item、他們必須對話的 NPC 或他們必須完成的競技場。 |
amount | 用於設定必須擊殺的 Custom Bosses 數量或必須獲得的物品數量。如果未指定,則預設為 1。 |
dialog | 用於設定玩家與之對話的 NPC 的對話內容。 |
name | 用於設定任務目標的名稱,無論是 NPC、自訂物品還是競技場。僅用於視覺目的。 |
itemName | 僅與 FETCH_ITEM 一起使用 – 此設定會更改物品名稱在任務追蹤器中的顯示方式。它允許您顯示與實際遊戲內物品名稱不同的自訂名稱。 |
請注意,每個 Custom Objective 欄位都使用 : 分隔!
customRewards
設定任務獎勵。
| 鍵 | 值 | 預設 |
|---|---|---|
customRewards | Universal EliteMobs loot format | none |
範例
customRewards:
- currencyAmount=50:amount=1:chance=0.05
- material=COOKED_COD:amount=3:chance=1.0
- filename=magmaguys_toothpick.yml:amount=1:chance=1.0

注意: 如果您不指定 customRewards,任務系統將根據任務等級自動生成獎勵。獎勵品質會隨任務難度而調整,包括貨幣和物品。為了精確控制獎勵,請始終明確指定 customRewards。
questAcceptPermission
設定玩家必須擁有才能接受任務的權限。
| 鍵 | 值 | 預設 |
|---|---|---|
questAcceptPermission | String | none |
範例
questAcceptPermission: elitequest.my_permission
questAcceptPermissions
設定玩家必須擁有才能接受任務的權限。
| 鍵 | 值 | 預設 |
|---|---|---|
questAcceptPermissions | String List | none |
範例
questAcceptPermissions:
- elitequest.my_previous_quest_one.yml
- elitequest.my_previous_quest_two.yml
questLockoutPermission
設定玩家完成任務後將獲得的權限,這將鎖定他們再次執行任務。如果未指定,任務鎖定權限將自動生成為 elitequest.[filename]。
| 鍵 | 值 | 預設 |
|---|---|---|
questLockoutPermission | String | elitequest.[filename] |
範例
questLockoutPermission: elitequest.my_quest.yml
questLockoutMinutes
設定玩家在能夠再次執行任務之前必須等待多長時間(以分鐘為單位)(透過移除任務鎖定權限來實現)。
| 鍵 | 值 | 預設 |
|---|---|---|
questLockoutMinutes | Integer | -1(will never repeat) |
範例
questLockoutMinutes: 60
name
設定任務名稱。接受 Color Codes。
| 鍵 | 值 | 預設 |
|---|---|---|
name | String | none |
範例
name: "&aMy Great Quest Name"
questLore
設定將出現在遊戲內任務選單中的任務描述。
| 鍵 | 值 | 預設 |
|---|---|---|
questLore | String List | none |
範例
questLore:
- "Interesting lore sentence."
- "Yet another interesting lore sentence."

temporaryPermissions
設定指派給玩家的權限,直到他們交回任務。
如果您使用此設定來確保物品僅在玩家擁有特定任務時掉落,您還需要在物品的配置檔中配置 Same Permission。
| 鍵 | 值 | 預設 |
|---|---|---|
temporaryPermissions | String List | none |
範例
temporaryPermissions:
- elitequest.item_that_should_drop_only_during_quest.yml
questAcceptDialog
設定接受任務時在聊天中出現的對話。
| 鍵 | 值 | 預設 |
|---|---|---|
questAcceptDialog | String List | none |
範例
questAcceptDialog:
- "My hero! You are so helpful!"
- "I wish you the best of luck!"

questCompleteMessage
設定完成任務時在聊天中出現的對話。
| 鍵 | 值 | 預設 |
|---|---|---|
questCompleteMessage | String List | none |
範例
questCompleteMessage:
- "My hero! You have completed my difficult quest!"
- "As a reward you can have this loaf of bread!"

questCompleteCommands
設定完成任務時將執行的指令。支援佔位符:$player 代表玩家名稱,$getX、$getY、$getZ 代表玩家位置座標。
| 鍵 | 值 | 預設 |
|---|---|---|
questCompleteCommands | String List | none |
範例
questCompleteCommands:
- say $player has finished a quest at $getX, $getY, $getZ!
- give $player diamond 1
![]()
turnInNPC
設定玩家需要與之對話/互動以完成任務的 NPC 的檔案名稱。這不必須是發放任務的同一個 NPC。
| 鍵 | 值 | 預設 |
|---|---|---|
turnInNPC | Filename | none |
範例
turnInNPC: my_cool_quest_npc.yml
Quest Givers
要將任務分配給會將其交給玩家的 NPC,您需要配置 NPC 檔案,而不是任務檔案。
在您的 NPC 配置檔案(~/plugins/EliteMobs/npcs/)中,添加:
questFileName: my_quest.yml
對於提供多個任務的 NPC:
questFileName:
- quest_one.yml
- quest_two.yml
請參閱 NPC 創建文件以獲取有關配置 NPC 的更多資訊。
trackable
設定任務是否將使用任務追蹤器。
| 鍵 | 值 | 預設 |
|---|---|---|
trackable | Boolean | true |
範例
trackable: true
questLevel
設定任務的等級。這只是一個視覺指南,以便玩家可以了解任務的挑戰性。這不會以任何方式修改首領、物品或其他等級。
| 鍵 | 值 | 預設 |
|---|---|---|
questLevel | Integer | 0 |
範例
questLevel: 10

questAcceptSound
設定接受任務時播放的聲音。可以播放 Minecraft 聲音和資源包中的聲音。
| 鍵 | 值 | 預設 |
|---|---|---|
questAcceptSound | String | none |
範例
questAcceptSound: entity.experience_orb.pickup

questCompleteSound
設定完成任務(交回)時播放的聲音。可以播放 Minecraft 聲音和資源包中的聲音。
| 鍵 | 值 | 預設 |
|---|---|---|
questCompleteSound | String | none |
範例
questCompleteSound: entity.player.levelup

Localization Support
以下欄位支援多語言伺服器的本地化:
namequestLorequestAcceptDialogquestCompleteMessage
這允許您為伺服器上的不同語言提供翻譯。
Permissions
如上表所述,權限通常是 Strings 或 String Lists。但讓我們更詳細地了解您將如何使用這些來鎖定和解鎖任務。
假設您正在製作一系列任務中的 quest_3,並且您不希望玩家能夠在完成 quest_2 之前接受 quest_3。我們將像這樣配置任務檔案:
questAcceptPermission: elitequest.quest_2.yml
questLockoutPermission: elitequest.quest_3.yml
透過將 questAcceptPermissions 設定為 elitequest.quest_2.yml,我們現在阻止玩家在完成 quest_2.yml 之前接受 quest_3.yml。
透過將 questLockoutPermission 設定為 elitequest.quest_3.yml,我們阻止玩家在他們的追蹤器中已經擁有該任務或已經完成該任務的情況下能夠接受該任務。這阻止玩家能夠重複任務。
如果您想製作一個僅在玩家完成一系列任務後才可用的任務,那麼您將像這樣配置任務檔案:
questAcceptPermissions:
- elitequest.quest_2.yml
- elitequest.quest_3.yml
- elitequest.quest_4.yml
如果您希望玩家僅在擁有正確任務時才能掉落某些物品,那麼我們可以使用 temporaryPermissions 來實現。我們將使用 temporaryPermissions 在任務檔案中製作一個權限,然後在物品檔案中使用 permission 製作一個匹配的 permission。
例如,我們將打開我們的任務檔案並添加以下內容:
temporaryPermissions:
- elitequest.my_cool_item.yml
然後我們將打開物品檔案,在我們的案例中是 my_cool_item.yml,然後添加以下內容:
permission: elitequest.my_cool_item.yml
兩個檔案現在都有匹配的權限,這應該現在使我們的物品僅在玩家擁有正確任務時才會掉落。
