Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- command /equip [<text>]:
- trigger:
- open chest with 6 rows named "&e&l 裝備介面" to player
- wait 1 ticks
- if inventory name of player's current inventory contains "裝備介面":
- loop 54 times:
- set slot (loop-number - 1) of player's current inventory to 1 of snow layer named "&f空白欄"
- loop 9 times:
- set slot (loop-number - 1) of player's current inventory to 1 of gray stained glass pane named "&7"
- set slot (loop-number + 45) of player's current inventory to 1 of gray stained glass pane named "&7"
- loop 5 times:
- set slot ((loop-number - 1) * 9) of player's current inventory to 1 of gray stained glass pane named "&7"
- set slot ((loop-number - 1) * 9 + 8) of player's current inventory to 1 of gray stained glass pane named "&7"
- set slot 0 of player's current inventory to 1 of red stained glass pane named "&7"
- set slot 45 of player's current inventory to 1 of red stained glass pane named "&7"
- set slot 8 of player's current inventory to 1 of red stained glass pane named "&7"
- set slot 53 of player's current inventory to 1 of red stained glass pane named "&7"
- loop 4 times:
- set slot (9 * loop-number) of player's current inventory to 1 of black stained glass pane named "&7"
- set slot (9 * loop-number + 8) of player's current inventory to 1 of black stained glass pane named "&7"
- set slot (loop-number * 9 + 3) of player's current inventory to 1 of black stained glass pane named "&7"
- set slot 10 of player's current inventory to leather helmet named "&e帽子" with lore "&9請放在旁邊的格子裏"
- set slot 19 of player's current inventory to leather chestplate named "&e衣服" with lore "&9請放在旁邊的格子裏"
- set slot 28 of player's current inventory to leather leggings named "&e褲子" with lore "&9請放在旁邊的格子裏"
- set slot 37 of player's current inventory to leather boots named "&e鞋子" with lore "&9請放在旁邊的格子裏"
- set slot 13 of player's current inventory to spawn egg named "&e寵物" with lore "&9請放在旁邊的格子裏"
- set slot 15 of player's current inventory to string named "&e墜飾" with lore "&9請放在旁邊的格子裏"
- set slot 22 of player's current inventory to wooden sword named "&e副手武器" with lore "&9請放在旁邊的格子裏"
- set slot 24 of player's current inventory to nether star named "&e勳章" with lore "&9請放在旁邊的格子裏"
- set slot 31 of player's current inventory to lead named "&e腰帶" with lore "&9請放在旁邊的格子裏"
- set slot 33 of player's current inventory to leather named "&e肩飾" with lore "&9請放在旁邊的格子裏"
- set slot 40 of player's current inventory to paper named "&e披風" with lore "&9請放在旁邊的格子裏"
- set slot 42 of player's current inventory to diamond named "&e戒指" with lore "&9請放在旁邊的格子裏"
- if file existance of "plugins/equip/%player%/1.yml" is true:
- set {_slot} to 11
- set {_裝備id.1} to single value "id" get of "plugins/equip/%player%/1.yml"
- set {_裝備id.1} to {_裝備id.1} parsed as item
- set {_nbt.1} to yaml value "nbt" from file "plugins/equip/%player%/1.yml"
- set slot {_slot} of player's current inventory to 1 of {_裝備id.1} with nbt "%{_nbt.1}%"
- set slot {_slot} of player's current inventory to 1 of slot {_slot} of player's current inventory
- if file existance of "plugins/equip/%player%/2.yml" is true:
- set {_slot} to 20
- set {_裝備id.2} to single value "id" get of "plugins/equip/%player%/2.yml"
- set {_裝備id.2} to {_裝備id.2} parsed as item
- set {_nbt.2} to yaml value "nbt" from file "plugins/equip/%player%/2.yml"
- set slot {_slot} of player's current inventory to 1 of {_裝備id.2} with nbt "%{_nbt.2}%"
- set slot {_slot} of player's current inventory to 1 of slot {_slot} of player's current inventory
- if file existance of "plugins/equip/%player%/3.yml" is true:
- set {_slot} to 29
- set {_裝備id.3} to single value "id" get of "plugins/equip/%player%/3.yml"
- set {_裝備id.3} to {_裝備id.3} parsed as item
- set {_nbt.3} to yaml value "nbt" from file "plugins/equip/%player%/3.yml"
- set slot {_slot} of player's current inventory to 1 of {_裝備id.3} with nbt "%{_nbt.3}%"
- set slot {_slot} of player's current inventory to 1 of slot {_slot} of player's current inventory
- if file existance of "plugins/equip/%player%/4.yml" is true:
- set {_slot} to 38
- set {_裝備id.4} to single value "id" get of "plugins/equip/%player%/4.yml"
- set {_裝備id.4} to {_裝備id.4} parsed as item
- set {_nbt.4} to yaml value "nbt" from file "plugins/equip/%player%/4.yml"
- set slot {_slot} of player's current inventory to 1 of {_裝備id.4} with nbt "%{_nbt.4}%"
- set slot {_slot} of player's current inventory to 1 of slot {_slot} of player's current inventory
- if file existance of "plugins/equip/%player%/5.yml" is true:
- set {_slot} to 14
- set {_裝備id.5} to single value "id" get of "plugins/equip/%player%/5.yml"
- set {_裝備id.5} to {_裝備id.5} parsed as item
- set {_nbt.5} to yaml value "nbt" from file "plugins/equip/%player%/5.yml"
- set slot {_slot} of player's current inventory to 1 of {_裝備id.5} with nbt "%{_nbt.5}%"
- set slot {_slot} of player's current inventory to 1 of slot {_slot} of player's current inventory
- if file existance of "plugins/equip/%player%/6.yml" is true:
- set {_slot} to 16
- set {_裝備id.6} to single value "id" get of "plugins/equip/%player%/6.yml"
- set {_裝備id.6} to {_裝備id.6} parsed as item
- set {_nbt.6} to yaml value "nbt" from file "plugins/equip/%player%/6.yml"
- set slot {_slot} of player's current inventory to 1 of {_裝備id.6} with nbt "%{_nbt.6}%"
- set slot {_slot} of player's current inventory to 1 of slot {_slot} of player's current inventory
- if file existance of "plugins/equip/%player%/7.yml" is true:
- set {_slot} to 23
- set {_裝備id.7} to single value "id" get of "plugins/equip/%player%/7.yml"
- set {_裝備id.7} to {_裝備id.7} parsed as item
- set {_nbt.7} to yaml value "nbt" from file "plugins/equip/%player%/7.yml"
- set slot {_slot} of player's current inventory to 1 of {_裝備id.7} with nbt "%{_nbt.7}%"
- set slot {_slot} of player's current inventory to 1 of slot {_slot} of player's current inventory
- if file existance of "plugins/equip/%player%/8.yml" is true:
- set {_slot} to 25
- set {_裝備id.8} to single value "id" get of "plugins/equip/%player%/8.yml"
- set {_裝備id.8} to {_裝備id.8} parsed as item
- set {_nbt.8} to yaml value "nbt" from file "plugins/equip/%player%/8.yml"
- set slot {_slot} of player's current inventory to 1 of {_裝備id.8} with nbt "%{_nbt.8}%"
- set slot {_slot} of player's current inventory to 1 of slot {_slot} of player's current inventory
- if file existance of "plugins/equip/%player%/9.yml" is true:
- set {_slot} to 32
- set {_裝備id.9} to single value "id" get of "plugins/equip/%player%/9.yml"
- set {_裝備id.9} to {_裝備id.9} parsed as item
- set {_nbt.9} to yaml value "nbt" from file "plugins/equip/%player%/9.yml"
- set slot {_slot} of player's current inventory to 1 of {_裝備id.9} with nbt "%{_nbt.9}%"
- set slot {_slot} of player's current inventory to 1 of slot {_slot} of player's current inventory
- if file existance of "plugins/equip/%player%/10.yml" is true:
- set {_slot} to 34
- set {_裝備id.10} to single value "id" get of "plugins/equip/%player%/10.yml"
- set {_裝備id.10} to {_裝備id.10} parsed as item
- set {_nbt.10} to yaml value "nbt" from file "plugins/equip/%player%/10.yml"
- set slot {_slot} of player's current inventory to 1 of {_裝備id.10} with nbt "%{_nbt.10}%"
- set slot {_slot} of player's current inventory to 1 of slot {_slot} of player's current inventory
- if file existance of "plugins/equip/%player%/11.yml" is true:
- set {_slot} to 41
- set {_裝備id.11} to single value "id" get of "plugins/equip/%player%/11.yml"
- set {_裝備id.11} to {_裝備id.11} parsed as item
- set {_nbt.11} to yaml value "nbt" from file "plugins/equip/%player%/11.yml"
- set slot {_slot} of player's current inventory to 1 of {_裝備id.11} with nbt "%{_nbt.11}%"
- set slot {_slot} of player's current inventory to 1 of slot {_slot} of player's current inventory
- if file existance of "plugins/equip/%player%/12.yml" is true:
- set {_slot} to 43
- set {_裝備id.12} to single value "id" get of "plugins/equip/%player%/12.yml"
- set {_裝備id.12} to {_裝備id.12} parsed as item
- set {_nbt.12} to yaml value "nbt" from file "plugins/equip/%player%/12.yml"
- set slot {_slot} of player's current inventory to 1 of {_裝備id.12} with nbt "%{_nbt.12}%"
- set slot {_slot} of player's current inventory to 1 of slot {_slot} of player's current inventory
- on inventory click:
- if inventory name of player's current inventory contains "裝備介面":
- if name of clicked item is "&7":
- cancel event
- wait 1 ticks
- close player's inventory
- stop
- if line 1 of lore of clicked item is "&9請放在旁邊的格子裏":
- cancel event
- wait 1 ticks
- close player's inventory
- stop
- if clicked type is left mouse button or double click using mouse:
- if name of clicked item is "&f空白欄":
- set clicked item to air
- if line 1 of lore of slot (clicked raw slot - 1) of player's current inventory is "&9請放在旁邊的格子裏":
- if "%name of clicked item%" isn't "<none>" or "&f空白欄":
- set {_lore::*} to uncolored lore of clicked item split at "||"#設定lore為所有的注釋
- loop {_lore::*}:#循環讀取所有lore一次
- if {_lore::%loop-index%} contains "-":
- replace all "-" and " " with "" in {_lore::%loop-index%}
- set {_save} to "%{_lore::%loop-index%}%"
- set {_save2} to "%{_save}%"
- loop 10 times:
- replace all "%loop-number - 1%" with "" in {_save}
- replace all "%{_save}%" with "" in {_save2}
- set {_save2} to {_save2} parsed as integer
- set {玩家資料.%player%::%{_save}%} to {玩家資料.%player%::%{_save}%} - {_save2}
- if id of clicked cursor is 0:#如果按的物品是空氣
- stop
- else:
- set {_name} to clicked cursor
- if "%{_name}%" is "<none>":#如果按的物品沒有名稱
- cancel event
- stop
- set {_pass} to 0
- set {_lore::*} to uncolored lore of clicked cursor split at "||"#設定lore為所有的注釋
- loop {_lore::*}:#循環讀取所有lore一次
- set {_name} to slot (clicked raw slot - 1) of player's current inventory
- set {_name} to uncolored name of {_name}
- if {_lore::%loop-index%} contains "%{_name}%":
- set {_pass} to 1
- if {_pass} is 0:
- cancel event
- if {_pass} is 1:
- loop {_lore::*}:
- if {_lore::%loop-index%} contains "等級需求":
- replace all "等級需求" , ":" and " " with "" in {_lore::%loop-index%}
- set {_lore::%loop-index%} to {_lore::%loop-index%} parsed as integer
- if {玩家資料.%player%::玩家等級} is more than or equal to {_lore::%loop-index%}:
- set {_pass} to 3
- exit loop
- set {_pass} to 2
- if {_pass} is 2:
- send "&c裝備%name of clicked cursor% &c不符合玩家等級。"
- cancel event
- if {_pass} is 3:
- set {_lore::*} to uncolored lore of clicked cursor split at "||"#設定lore為所有的注釋
- loop {_lore::*}:#循環讀取所有lore一次
- if {_lore::%loop-index%} contains "-":
- replace all "-" and " " with "" in {_lore::%loop-index%}
- set {_save} to "%{_lore::%loop-index%}%"
- set {_save2} to "%{_save}%"
- loop 10 times:
- replace all "%loop-number - 1%" with "" in {_save}
- replace all "%{_save}%" with "" in {_save2}
- set {_save2} to {_save2} parsed as integer
- set {玩家資料.%player%::%{_save}%} to {玩家資料.%player%::%{_save}%} + {_save2}
- else:
- send "裝備介面只允許左鍵點擊"
- cancel event
- on mor.inventory click:
- wait 1 ticks
- if name of event-inventory contains "裝備介面":
- loop 54 times:
- if slot (loop-number - 1) of player's current inventory is a air:
- set slot (loop-number - 1) of player's current inventory to 1 of snow layer named "&f空白欄"
- on inventory close:
- if inventory name of player's current inventory contains "裝備介面":
- if name of slot 11 of player's current inventory isn't "&f空白欄":
- set {_number} to 1
- set {_slot} to 11
- if file existance of "plugins/equip/%player%/1.yml" is false:
- create file "plugins/equip/%player%/1.yml"
- set "id" to "%type of slot {_slot} of player's current inventory%" in yaml file "plugins/equip/%player%/%{_number}%.yml"
- set yaml value "nbt" from file "plugins/equip/%player%/%{_number}%.yml" to "%nbt of slot {_slot} of player's current inventory%"
- if name of slot 11 of player's current inventory is "&f空白欄":
- df "plugins/equip/%player%/1.yml"
- if name of slot 20 of player's current inventory isn't "&f空白欄":
- set {_number} to 2
- set {_slot} to 20
- if file existance of "plugins/equip/%player%/2.yml" is false:
- create file "plugins/equip/%player%/2.yml"
- set "id" to "%type of slot {_slot} of player's current inventory%" in yaml file "plugins/equip/%player%/%{_number}%.yml"
- set yaml value "nbt" from file "plugins/equip/%player%/%{_number}%.yml" to "%nbt of slot {_slot} of player's current inventory%"
- if name of slot 20 of player's current inventory is "&f空白欄":
- df "plugins/equip/%player%/2.yml"
- if name of slot 29 of player's current inventory isn't "&f空白欄":
- set {_number} to 3
- set {_slot} to 29
- if file existance of "plugins/equip/%player%/3.yml" is false:
- create file "plugins/equip/%player%/3.yml"
- set "id" to "%type of slot {_slot} of player's current inventory%" in yaml file "plugins/equip/%player%/%{_number}%.yml"
- set yaml value "nbt" from file "plugins/equip/%player%/%{_number}%.yml" to "%nbt of slot {_slot} of player's current inventory%"
- if name of slot 29 of player's current inventory is "&f空白欄":
- df "plugins/equip/%player%/3.yml"
- if name of slot 38 of player's current inventory isn't "&f空白欄":
- set {_number} to 4
- set {_slot} to 38
- if file existance of "plugins/equip/%player%/4.yml" is false:
- create file "plugins/equip/%player%/4.yml"
- set "id" to "%type of slot {_slot} of player's current inventory%" in yaml file "plugins/equip/%player%/%{_number}%.yml"
- set yaml value "nbt" from file "plugins/equip/%player%/%{_number}%.yml" to "%nbt of slot {_slot} of player's current inventory%"
- if name of slot 38 of player's current inventory is "&f空白欄":
- df "plugins/equip/%player%/4.yml"
- if name of slot 14 of player's current inventory isn't "&f空白欄":
- set {_number} to 5
- set {_slot} to 14
- if file existance of "plugins/equip/%player%/5.yml" is false:
- create file "plugins/equip/%player%/5.yml"
- set "id" to "%type of slot {_slot} of player's current inventory%" in yaml file "plugins/equip/%player%/%{_number}%.yml"
- set yaml value "nbt" from file "plugins/equip/%player%/%{_number}%.yml" to "%nbt of slot {_slot} of player's current inventory%"
- if name of slot 14 of player's current inventory is "&f空白欄":
- df "plugins/equip/%player%/5.yml"
- if name of slot 16 of player's current inventory isn't "&f空白欄":
- set {_number} to 6
- set {_slot} to 16
- if file existance of "plugins/equip/%player%/6.yml" is false:
- create file "plugins/equip/%player%/6.yml"
- set "id" to "%type of slot {_slot} of player's current inventory%" in yaml file "plugins/equip/%player%/%{_number}%.yml"
- set yaml value "nbt" from file "plugins/equip/%player%/%{_number}%.yml" to "%nbt of slot {_slot} of player's current inventory%"
- if name of slot 16 of player's current inventory is "&f空白欄":
- df "plugins/equip/%player%/6.yml"
- if name of slot 23 of player's current inventory isn't "&f空白欄":
- set {_number} to 7
- set {_slot} to 23
- if file existance of "plugins/equip/%player%/7.yml" is false:
- create file "plugins/equip/%player%/7.yml"
- set "id" to "%type of slot {_slot} of player's current inventory%" in yaml file "plugins/equip/%player%/%{_number}%.yml"
- set yaml value "nbt" from file "plugins/equip/%player%/%{_number}%.yml" to "%nbt of slot {_slot} of player's current inventory%"
- if name of slot 23 of player's current inventory is "&f空白欄":
- df "plugins/equip/%player%/7.yml"
- if name of slot 25 of player's current inventory isn't "&f空白欄":
- set {_number} to 8
- set {_slot} to 25
- if file existance of "plugins/equip/%player%/8.yml" is false:
- create file "plugins/equip/%player%/8.yml"
- set "id" to "%type of slot {_slot} of player's current inventory%" in yaml file "plugins/equip/%player%/%{_number}%.yml"
- set yaml value "nbt" from file "plugins/equip/%player%/%{_number}%.yml" to "%nbt of slot {_slot} of player's current inventory%"
- if name of slot 25 of player's current inventory is "&f空白欄":
- df "plugins/equip/%player%/8.yml"
- if name of slot 32 of player's current inventory isn't "&f空白欄":
- set {_number} to 9
- set {_slot} to 32
- if file existance of "plugins/equip/%player%/9.yml" is false:
- create file "plugins/equip/%player%/9.yml"
- set "id" to "%type of slot {_slot} of player's current inventory%" in yaml file "plugins/equip/%player%/%{_number}%.yml"
- set yaml value "nbt" from file "plugins/equip/%player%/%{_number}%.yml" to "%nbt of slot {_slot} of player's current inventory%"
- if name of slot 32 of player's current inventory is "&f空白欄":
- df "plugins/equip/%player%/9.yml"
- if name of slot 34 of player's current inventory isn't "&f空白欄":
- set {_number} to 10
- set {_slot} to 34
- if file existance of "plugins/equip/%player%/10.yml" is false:
- create file "plugins/equip/%player%/10.yml"
- set "id" to "%type of slot {_slot} of player's current inventory%" in yaml file "plugins/equip/%player%/%{_number}%.yml"
- set yaml value "nbt" from file "plugins/equip/%player%/%{_number}%.yml" to "%nbt of slot {_slot} of player's current inventory%"
- if name of slot 34 of player's current inventory is "&f空白欄":
- df "plugins/equip/%player%/10.yml"
- if name of slot 41 of player's current inventory isn't "&f空白欄":
- set {_number} to 11
- set {_slot} to 41
- if file existance of "plugins/equip/%player%/11.yml" is false:
- create file "plugins/equip/%player%/11.yml"
- set "id" to "%type of slot {_slot} of player's current inventory%" in yaml file "plugins/equip/%player%/%{_number}%.yml"
- set yaml value "nbt" from file "plugins/equip/%player%/%{_number}%.yml" to "%nbt of slot {_slot} of player's current inventory%"
- if name of slot 41 of player's current inventory is "&f空白欄":
- df "plugins/equip/%player%/11.yml"
- if name of slot 43 of player's current inventory isn't "&f空白欄":
- set {_number} to 12
- set {_slot} to 43
- if file existance of "plugins/equip/%player%/12.yml" is false:
- create file "plugins/equip/%player%/12.yml"
- set "id" to "%type of slot {_slot} of player's current inventory%" in yaml file "plugins/equip/%player%/%{_number}%.yml"
- set yaml value "nbt" from file "plugins/equip/%player%/%{_number}%.yml" to "%nbt of slot {_slot} of player's current inventory%"
- if name of slot 43 of player's current inventory is "&f空白欄":
- df "plugins/equip/%player%/12.yml"
- command /resetequip:
- trigger:
- loop 12 times:
- set {_number} to loop-number
- df "plugins/equip/%player%/%{_number}%.yml"
Advertisement
Add Comment
Please, Sign In to add comment