在無模組的外掛伺服器中,往往需要練習記憶不同命令,去達到一些功能像是:交易、任務、屬性等。但其實有更好的方式:鍵盤命令連結可以讓你用快速鍵「執行」命令!
關於外掛
作者:RAZEMC
外掛連結:https://www.spigotmc.org/resources/key-command-bind.48679/
支援版本:1.9 – 1.17
是否仍在維護?不詳
是否開放原始碼?無
特色
支援快捷欄 (Hotbar) 切換觸發
支援觸發冷卻時間
支援經濟外掛:以金錢支付 (需要安裝 Vault 外掛)
支援經驗消耗
支援權限限制
支援提示訊息
當沒有權限使用鍵盤組合的提示訊息
當冷卻時間還未結束的提示訊息
當經驗值不足以扣除的提示訊息
當金錢不足以扣除的提示訊息
可設定暫停觸發當玩家飛行時
可設定暫停觸發當玩家潛行時
可設定關閉玩家慣用手交換
關聯外掛
Vault (用於金錢消耗,選用)
PlaceholderAPI (用於提示訊息的變數文字插入,選用)
說明
此外掛主要是針對快捷欄的伺服器事件應用。
部份鍵盤事件是必須要由伺服器「認同」才能完成的操作,例如移動、蹲下/潛行、快捷欄切換等。因此快捷欄在切換的時候,伺服器不僅會知道,還能夠對這類的操作進行更進一步的動作。此外掛是以這功能達到目的。
同樣的除了快捷欄的鍵盤事件之外,還有另外兩個一樣是伺服器會知道、可以組合的鍵盤事件:「Shift 蹲下/潛行」與「F 切換道具到(非)慣用手」。
當切換慣用手的時候(按下 F 鍵)同時,會根據不同快捷欄位置做出不同反應。但須注意下面兩種是同一個意思:
只按下 F 。按下 F 的時候快捷欄選在位置 3 。
同時按下 F + 3 。
根據以上的內容,可以進行的快速鍵組合為:
按下 1 – 9 的鍵盤組合([1-9])
按下 F 的鍵盤組合 (F),並根據9個快捷欄位設定不同功能 (F 或 F + [1-9])
在按下 Shift 的時候,按下 1 – 9 的鍵盤組合 (Shift + [1-9])
在按下 Shift 的時候,按下 F 的鍵盤組合 (Shift + F 或 Shift + F + [1-9]),並根據9個快捷欄位設定不同功能
範例設定
disableMessages: false
swapModeEnabled: false
keyPressModeEnabled: false
keyPressMode:
key1:
enabled: false
returnKeyEnabled: false
returnKeySlot: 1
sneakingOnly: false
disableOnSneak: false
disableOnFly: false
usePermission: false
permission: kcb.key1
noPermissionMessageEnabled: false
noPermissionMessage: Key is still in cooldown
cooldownMilliSeconds: 500
cooldownMessageEnabled: false
cooldownMessage: Key is still in cooldown
enabledExpCost: false
expCost: 1
insufficientExpMessageEnabled: false
insufficientExpMessage: Insufficient exp to run command
moneyCostEnabled: false
moneyCost: 1
insufficientMoneyMessageEnabled: false
insufficientMoneyMessage: Insufficient exp to run command
commands:
- version
- -c- say %kcbPlayer% executed a console command
swapMode:
key1:
enabled: false
disableSwap: false
sneakingOnly: false
disableOnSneak: false
disableOnFly: false
usePermission: false
permission: kcb.key1
noPermissionMessageEnabled: false
noPermissionMessage: Key is still in cooldown
cooldownMilliSeconds: 500
cooldownMessageEnabled: false
cooldownMessage: Key is still in cooldown
enabledExpCost: false
expCost: 1
insufficientExpMessageEnabled: false
insufficientExpMessage: Insufficient exp to run command
moneyCostEnabled: false
moneyCost: 1
insufficientMoneyMessageEnabled: false
insufficientMoneyMessage: Insufficient exp to run command
commands:
- version
- -c- say %kcbPlayer% executed a console command
language:
prefix: '&a&l[&6&lKCB&a&l]&l'
noConfigFound: No config found, generating default config
configLoaded: Config Loaded
參數解釋
disableMessage: # (bool) 關閉全域訊息
swapModeEnabled: # (bool) 啟用交換模式 (F 鍵功能)
keyPressModeEnabled: #(bool) 啟用鍵盤按下模式 (1 - 9功能)
keyPressMode: # (object) 鍵盤按下模式設定
swapMode: # (object) 交換模式下的設定
language: # (object) 除錯提示訊息
keyPressMode
keyPressMode:
key1: # (object) 按下快捷欄位置 1 的設定
key2: # (object) 按下快捷欄位置 2 的設定
key3: # (object) 按下快捷欄位置 3 的設定
key4: # (object) 按下快捷欄位置 4 的設定
key5: # (object) 按下快捷欄位置 5 的設定
key6: # (object) 按下快捷欄位置 6 的設定
key7: # (object) 按下快捷欄位置 7 的設定
key8: # (object) 按下快捷欄位置 8 的設定
key9: # (object) 按下快捷欄位置 9 的設定
keyPressMode.key1
keyPressMode:
key1:
# (bool) 啟用這個按鍵
enabled: false
# (bool) 啟用時,按下按鍵立即返回另一個快捷欄插槽
returnKeyEnabled: false
# (0-8) 返回到快捷欄插槽編號 (0開始)
returnKeySlot: 1
# (bool) 啟用時,必須加上 Shift 按下
sneakingOnly: false
# (bool) 啟用時,如果按下 Shift 且在移動的狀況下(潛行) 不觸發按鍵
disableOnSneak: false
# (bool) 啟用時,如果飛行則不觸發按鍵
disableOnFly: false
# (bool) 啟用時,需要足夠權限才能夠按下
usePermission: false
# (string) 啟用權限時,權限的對應鍵值
permission: kcb.key1
# (bool) 啟用時,若有啟用權限,在權限不足時提示玩家訊息
noPermissionMessageEnabled: false
# (string) 啟用權限時,當權限不足時,提示玩家的訊息內容
noPermissionMessage: Key require permission
# (bool) 啟用時,每次按鍵之間需要冷卻時間
cooldownMessageEnabled: false
# (number) 啟用冷卻時間時,需要冷卻的時間長度
cooldownMilliSeconds: 500
# (string) 啟用冷卻時間時,當冷卻時間未結束時,提示玩家的訊息內容
cooldownMessage: Key is still in cooldown
# (bool) 啟用時,需要消耗經驗
enabledExpCost: false
# (number) 啟用經驗消耗時,需要消耗的經驗數量
expCost: 1
# (bool) 啟用時,若有啟用經驗消耗,在經驗不足時提示玩家訊息
insufficientExpMessageEnabled: false
# (string) 啟用消耗經驗時,當經驗不足夠消耗時,提示玩家的訊息內容
insufficientExpMessage: Insufficient exp to run command
# (bool) 啟用時,需要消耗金錢
moneyCostEnabled: false
# (number) 啟用金錢消耗時,需要消耗的金錢數量
moneyCost: 1
# (bool) 啟用時,若有金錢消耗,在金錢不足時提示玩家訊息
insufficientMoneyMessageEnabled: false
# (string) 啟用金錢消耗時,當金錢不足夠消耗時,提示玩家的訊息內容
insufficientMoneyMessage: Insufficient exp to run command
# (array, string) 當按鍵啟用時,觸發按鍵執行的命令(每行一個命令)
commands:
# 顯示遊戲版本訊息
- version
# -c- 以伺服器執行。%kcbPlayer% 按下按鍵的玩家。
- -c- say %kcbPlayer% executed a console command
swapMode
swapMode:
key1: # (object) 在快捷欄位置 1 時按下 F 設定
key2: # (object) 在快捷欄位置 2 時按下 F 設定
key3: # (object) 在快捷欄位置 3 時按下 F 設定
key4: # (object) 在快捷欄位置 4 時按下 F 設定
key5: # (object) 在快捷欄位置 5 時按下 F 設定
key6: # (object) 在快捷欄位置 6 時按下 F 設定
key7: # (object) 在快捷欄位置 7 時按下 F 設定
key8: # (object) 在快捷欄位置 8 時按下 F 設定
key9: # (object) 在快捷欄位置 9 時按下 F 設定
swapMode.key1
swapMode:
key1:
# (bool) 啟用這個按鍵
enabled: false
# (bool) 啟用時,玩家無法將物品放置非慣用手
disableSwap: false
# (bool) 啟用時,必須加上 Shift 按下
sneakingOnly: false
# (bool) 啟用時,如果按下 Shift 且在移動的狀況下(潛行) 不觸發按鍵
disableOnSneak: false
# (bool) 啟用時,如果飛行則不觸發按鍵
disableOnFly: false
# (bool) 啟用時,需要足夠權限才能夠按下
usePermission: false
# (string) 啟用權限時,權限的對應鍵值
permission: kcb.key1
# (bool) 啟用時,若有啟用權限,在權限不足時提示玩家訊息
noPermissionMessageEnabled: false
# (string) 啟用權限時,當權限不足時,提示玩家的訊息內容
noPermissionMessage: Key require permission
# (bool) 啟用時,每次按鍵之間需要冷卻時間
cooldownMessageEnabled: false
# (number) 啟用冷卻時間時,需要冷卻的時間長度
cooldownMilliSeconds: 500
# (string) 啟用冷卻時間時,當冷卻時間未結束時,提示玩家的訊息內容
cooldownMessage: Key is still in cooldown
# (bool) 啟用時,需要消耗經驗
enabledExpCost: false
# (number) 啟用經驗消耗時,需要消耗的經驗數量
expCost: 1
# (bool) 啟用時,若有啟用經驗消耗,在經驗不足時提示玩家訊息
insufficientExpMessageEnabled: false
# (string) 啟用消耗經驗時,當經驗不足夠消耗時,提示玩家的訊息內容
insufficientExpMessage: Insufficient exp to run command
# (bool) 啟用時,需要消耗金錢
moneyCostEnabled: false
# (number) 啟用金錢消耗時,需要消耗的金錢數量
moneyCost: 1
# (bool) 啟用時,若有金錢消耗,在金錢不足時提示玩家訊息
insufficientMoneyMessageEnabled: false
# (string) 啟用金錢消耗時,當金錢不足夠消耗時,提示玩家的訊息內容
insufficientMoneyMessage: Insufficient exp to run command
# (array, string) 當按鍵啟用時,觸發按鍵執行的命令(每行一個命令)
commands:
# 顯示遊戲版本訊息
- version
# -c- 以伺服器執行。%kcbPlayer% 按下按鍵的玩家。
- -c- say %kcbPlayer% executed a console command
language
language:
# (string), 提示訊息的前綴
prefix: '&a&l[&6&lKCB&a&l]&l'
noConfigFound: 沒有找到設定檔(config.yml)。將產生預設設定檔到 plugins/KeyCommandBind
configLoaded: 設定已重新載入。
限制
由於某些不確定的原因,這個外掛有些設定上的限制。
按鍵組合至多 18 種
雖然上面列出的組合,理論上可以組合出 36 種設定。但它只能辦到其中的 18 種。原因在於外掛設計上,設定檔是規劃按 [1 – 9] 或是按 F + [1 – 9] ,這樣就至多 18 種。Shift 只是這 18 種設定的一個附加條件,不能額外個別設定有無按住 Shift 的條件。
按鍵觸發 1 – 9 時會有可能無法觸發
在 1.17 的環境下測試,會有可能因為快捷欄已經在選擇的位置上,而「有可能」無法觸發。有可能的部份是指,當你多次按下相同數字鍵時,會有幾次是不會有反應的。