Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- on load:
- delete {kitpvp.duel.receiveduel::*}
- delete {kitpvp.duel.latestreceiveduel::*}
- delete {kitpvp.duel.sendduel::*}
- delete {kitpvp.duel.sendduelmode::*}
- delete {kitpvp.duel.waitingaccept::*}
- delete {kitpvp.duel.using::*}
- delete {kitpvp.duel.matchtime::*}
- delete {kitpvp.duel.duelmode::*}
- delete {kitpvp.duel.usingarena::*}
- delete {kitpvp.duel.opponent::*}
- delete {kitpvp.duel.waitingplayers.kitpvp::*}
- delete {kitpvp.duel.waitingplayers.builduhc::*}
- delete {kitpvp.duel.waitingplayers.potpvp::*}
- delete {kitpvp.duel.waitingplayers.archer::*}
- delete {kitpvp.duel.waitingplayers.gapple::*}
- delete {kitpvp.duel.waitingplayers.combo::*}
- loop {kitpvp.duel.arena::*}:
- {kitpvp.duel.playerplacedblocks.%loop-value%::*}
- {kitpvp.duel.lobby} is not set
- set {kitpvp.duel.lobby} to location at 0, 64, 0 in world "world"
- function getTimerFromTicks(ticks: number) :: string:
- set {_seconds} to floor({_ticks}/20)
- set {_minutes} to floor({_seconds}/60)
- set {_seconds} to {_seconds}-60*{_minutes}
- if {_minutes} < 10:
- set {_minutes} to "0%{_minutes}%"
- if {_seconds} < 10:
- set {_seconds} to "0%{_seconds}%"
- return "%{_minutes}%:%{_seconds}%"
- function getItemStackFromID(id: number, data: number) :: item:
- loop all itemtypes:
- id of loop-value is {_id}
- set {_value} to loop-value
- set durability of {_value} to {_data}
- return {_value}
- stop loop
- command /setduellobby:
- permission: kitpvp.admin
- permission message: &cYou do not have permission to use this command.
- trigger:
- set {kitpvp.duel.lobby} to location of block at player
- set yaw of {kitpvp.duel.lobby} to yaw of player
- set pitch of {kitpvp.duel.lobby} to pitch of player
- send "&a1v1の待機場所を&e%{kitpvp.duel.lobby}%&aに設定しました"
- command /arena [<text>] [<text>]:
- permission: kitpvp.admin
- permission message: &cYou do not have permission to use this command.
- trigger:
- if arg-1 is not set:
- send "&cUsage: /arena <addarena|removearena|info|tp1|tp2|bounds> <arena> OR /arena list"
- else if arg-1 is not "addarena" or "removearena" or "info" or "tp1" or "tp2" or "bounds" or "list":
- send "&cUsage: /arena <addarena|removearena|info|tp1|tp2|bounds> <arena> OR /arena list"
- else if arg-1 is "addarena" or "removearena" or "info" or "tp1" or "tp2" or "bounds":
- if arg-2 is not set:
- send "&cUsage: /arena %arg-1 in lower case% <arena>"
- else if arg-1 is "addarena":
- if {kitpvp.duel.arena::%arg-2%} is set:
- send "&cアリーナ%arg-2 in lower case%は既に存在しています"
- else if {kitpvp.duel.arena::%arg-2%} is not set:
- set {kitpvp.duel.arena::%arg-2%} to arg-2 in lower case
- set {kitpvp.duel.tp1::%arg-2%} to location of block at player
- set {kitpvp.duel.tp2::%arg-2%} to location of block at player
- set yaw of {kitpvp.duel.tp1::%arg-2%} to yaw of player
- set pitch of {kitpvp.duel.tp1::%arg-2%} to pitch of player
- set yaw of {kitpvp.duel.tp2::%arg-2%} to yaw of player
- set pitch of {kitpvp.duel.tp2::%arg-2%} to pitch of player
- set {kitpvp.duel.pos1::%arg-2%} to location of block at player
- set {kitpvp.duel.pos2::%arg-2%} to location of block at player
- send "&aアリーナ&e%arg-2 in lower case%&aを追加しました"
- else if arg-1 is "removearena":
- if {kitpvp.duel.arena::%arg-2%} is not set:
- send "&cアリーナ%arg-2 in lower case%は存在していません"
- else if {kitpvp.duel.arena::%arg-2%} is set:
- delete {kitpvp.duel.arena::%arg-2%}
- delete {kitpvp.duel.tp1::%arg-2%}
- delete {kitpvp.duel.tp2::%arg-2%}
- delete {kitpvp.duel.pos1::%arg-2%}
- delete {kitpvp.duel.pos2::%arg-2%}
- send "&aアリーナ&e%arg-2 in lower case%&aを消去しました"
- else if arg-1 is "info":
- if {kitpvp.duel.arena::%arg-2%} is not set:
- send "&cアリーナ%arg-2 in lower case%は存在していません"
- else if {kitpvp.duel.arena::%arg-2%} is set:
- send "&7-=-=-=-=-=-=-&bArena Info&7-=-=-=-=-=-=-"
- send "&6Name: &e%arg-2 in lower case%"
- send "&6TP1: &e%{kitpvp.duel.tp1::%arg-2%}%"
- send "&6TP2: &e%{kitpvp.duel.tp2::%arg-2%}%"
- send "&6Bounds:"
- send " &6Pos1: &e%{kitpvp.duel.pos1::%arg-2%}%"
- send " &6Pos2: &e%{kitpvp.duel.pos2::%arg-2%}%"
- else if arg-1 is "tp1":
- if {kitpvp.duel.arena::%arg-2%} is not set:
- send "&cアリーナ%arg-2 in lower case%は存在していません"
- else if {kitpvp.duel.arena::%arg-2%} is set:
- set {kitpvp.duel.tp1::%arg-2%} to location of block at player
- set yaw of {kitpvp.duel.tp1::%arg-2%} to yaw of player
- set pitch of {kitpvp.duel.tp1::%arg-2%} to pitch of player
- send "&aアリーナ&e%arg-2 in lower case%&aのテレポート地点1を&e%{kitpvp.duel.tp1::%arg-2%}%&aに設定しました"
- else if arg-1 is "tp2":
- if {kitpvp.duel.arena::%arg-2%} is not set:
- send "&cアリーナ%arg-2 in lower case%は存在していません"
- else if {kitpvp.duel.arena::%arg-2%} is set:
- set {kitpvp.duel.tp2::%arg-2%} to location of block at player
- set yaw of {kitpvp.duel.tp2::%arg-2%} to yaw of player
- set pitch of {kitpvp.duel.tp2::%arg-2%} to pitch of player
- send "&aアリーナ&e%arg-2 in lower case%&aのテレポート地点2を&e%{kitpvp.duel.tp2::%arg-2%}%&aに設定しました"
- else if arg-1 is "bounds":
- if {kitpvp.duel.arena::%arg-2%} is not set:
- send "&cアリーナ%arg-2 in lower case%は存在していません"
- else if {kitpvp.duel.arena::%arg-2%} is set:
- set {_posstrs::*} to split "%selection of player%" by " and "
- set {_pos1coords::*} to split {_posstrs::1} by ", "
- set {_pos2coords::*} to split {_posstrs::2} by ", "
- set {kitpvp.duel.pos1::%arg-2%} to location at removePrefix({_pos1coords::1}, "x: ") parsed as number, removePrefix({_pos1coords::2}, "y: ") parsed as number, removePrefix({_pos1coords::3}, "z: ") parsed as number in world "%player's world%"
- set {kitpvp.duel.pos2::%arg-2%} to location at removePrefix({_pos2coords::1}, "x: ") parsed as number, removePrefix({_pos2coords::2}, "y: ") parsed as number, removePrefix({_pos2coords::3}, "z: ") parsed as number in world "%player's world%"
- send "&aアリーナ&e%arg-2 in lower case%&aの範囲を変更しました"
- send "&6Pos1: &e%{kitpvp.duel.pos1::%arg-2%}%"
- send "&6Pos2: &e%{kitpvp.duel.pos2::%arg-2%}%"
- else if arg-1 is "list":
- if {kitpvp.duel.arena::*} is not set:
- send "&cアリーナはひとつも存在しません"
- else if {kitpvp.duel.arena::*} is set:
- set {_arenaliststr} to "&e%join {kitpvp.duel.arena::*} by ""&f, &e""%"
- send "&7Arenas (%size of {kitpvp.duel.arena::*}%): %{_arenaliststr}%"
- on rightclick with diamond sword:
- name of player's tool is "&aDuels"
- cancel event
- open chest with 1 row named "&aDuel Menu" to player
- wait 1 tick
- set slot 0 of player's current inventory to iron sword with nbt "{display:{Name:""&6KitPvP""},HideFlags:2}"
- set slot 1 of player's current inventory to splash potion with nbt "{display:{Name:""&6PotPvP""},Potion:""minecraft:strong_healing"",HideFlags:32}"
- set slot 2 of player's current inventory to player head with nbt "{display:{Name:""&6BuildUHC""},SkullOwner:{Id:""e19442f7-4300-4004-b3cf-7d5ec3c72d0c"",Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvM2JiNjEyZWI0OTVlZGUyYzVjYTUxNzhkMmQxZWNmMWNhNWEyNTVkMjVkZmMzYzI1NGJjNDdmNjg0ODc5MWQ4In19fQ==""}]}}}"
- set slot 3 of player's current inventory to bow named "&6Archer"
- set slot 4 of player's current inventory to enchanted golden apple named "&6Gapple"
- set slot 5 of player's current inventory to diamond sword with nbt "{display:{Name:""&6Combo""},HideFlags:2}"
- on inventory click:
- inventory type of player's current inventory is "CHEST"
- inventory name of player's current inventory is "&aDuel Menu"
- "%player's current inventory%" is "inventory of <none>"
- cancel event
- inventory type of clicked inventory is "CHEST"
- inventory name of clicked inventory is "&aDuel Menu"
- "%clicked inventory%" is "inventory of <none>"
- set {_bool} to false
- if clicked item is iron sword:
- name of clicked item is "&6KitPvP"
- set {_bool} to true
- if clicked item is splash potion:
- name of clicked item is "&6PotPvP"
- set {_bool} to true
- if clicked item is player head:
- name of clicked item is "&6BuildUHC"
- set {_bool} to true
- if clicked item is bow:
- name of clicked item is "&6Archer"
- set {_bool} to true
- if clicked item is enchanted golden apple:
- name of clicked item is "&6Gapple"
- set {_bool} to true
- if clicked item is diamond sword:
- name of clicked item is "&6Combo"
- set {_bool} to true
- {_bool} is true
- play sound "BLOCK_NOTE_PLING" to player with volume 1 and pitch 5
- set selected hotbar slot of player to 0
- close player's inventory
- set {kitpvp.playingstate.%player%} to "waiting_duel"
- set {kitpvp.duel.waitingplayers.%removeColorCode(name of clicked item in lower case)%::%player%} to player
- clear player's inventory
- teleport player to {kitpvp.duel.lobby}
- set level of player to 0
- set level progress of player to 0
- set slot 0 of player's inventory to barrier named "&cBack to Lobby" with lore "&d&oUndroppable"
- wipe player sidebar
- on rightclick with barrier:
- name of player's tool is "&cBack to Lobby"
- cancel event
- leaveDUEL(player)
- teleportSpawn(player)
- on quit:
- leaveDUEL(player)
- function leaveDUEL(p: player):
- set {_bool} to false
- set {_mode} to ""
- if {kitpvp.duel.waitingplayers.kitpvp::*} contain {_p}:
- set {_bool} to true
- set {_mode} to "kitpvp"
- if {kitpvp.duel.waitingplayers.potpvp::*} contain {_p}:
- set {_bool} to true
- set {_mode} to "potpvp"
- if {kitpvp.duel.waitingplayers.builduhc::*} contain {_p}:
- set {_bool} to true
- set {_mode} to "builduhc"
- if {kitpvp.duel.waitingplayers.archer::*} contain {_p}:
- set {_bool} to true
- set {_mode} to "archer"
- if {kitpvp.duel.waitingplayers.gapple::*} contain {_p}:
- set {_bool} to true
- set {_mode} to "gapple"
- if {kitpvp.duel.waitingplayers.combo::*} contain {_p}:
- set {_bool} to true
- set {_mode} to "combo"
- {_bool} is true
- delete {kitpvp.duel.waitingplayers.%{_mode}%::%{_p}%}
- every tick:
- if size of {kitpvp.duel.waitingplayers.kitpvp::*} >= 2:
- set {_num} to 0
- loop {kitpvp.duel.waitingplayers.kitpvp::*}:
- if {_num} is 0:
- set {_p1} to loop-value
- delete {kitpvp.duel.waitingplayers.kitpvp::%loop-index%}
- else if {_num} is 1:
- set {_p2} to loop-value
- delete {kitpvp.duel.waitingplayers.kitpvp::%loop-index%}
- stop loop
- add 1 to {_num}
- send "&a対戦相手: &e%{_p2}%" to {_p1}
- send "&a対戦相手: &e%{_p1}%" to {_p2}
- startDuel({_p1}, {_p2}, "kitpvp")
- if size of {kitpvp.duel.waitingplayers.potpvp::*} >= 2:
- set {_num} to 0
- loop {kitpvp.duel.waitingplayers.potpvp::*}:
- if {_num} is 0:
- set {_p1} to loop-value
- delete {kitpvp.duel.waitingplayers.potpvp::%loop-index%}
- else if {_num} is 1:
- set {_p2} to loop-value
- delete {kitpvp.duel.waitingplayers.potpvp::%loop-index%}
- stop loop
- add 1 to {_num}
- send "&a対戦相手: &e%{_p2}%" to {_p1}
- send "&a対戦相手: &e%{_p1}%" to {_p2}
- startDuel({_p1}, {_p2}, "potpvp")
- if size of {kitpvp.duel.waitingplayers.builduhc::*} >= 2:
- set {_num} to 0
- loop {kitpvp.duel.waitingplayers.builduhc::*}:
- if {_num} is 0:
- set {_p1} to loop-value
- delete {kitpvp.duel.waitingplayers.builduhc::%loop-index%}
- else if {_num} is 1:
- set {_p2} to loop-value
- delete {kitpvp.duel.waitingplayers.builduhc::%loop-index%}
- stop loop
- add 1 to {_num}
- send "&a対戦相手: &e%{_p2}%" to {_p1}
- send "&a対戦相手: &e%{_p1}%" to {_p2}
- startDuel({_p1}, {_p2}, "builduhc")
- if size of {kitpvp.duel.waitingplayers.archer::*} >= 2:
- set {_num} to 0
- loop {kitpvp.duel.waitingplayers.archer::*}:
- if {_num} is 0:
- set {_p1} to loop-value
- delete {kitpvp.duel.waitingplayers.archer::%loop-index%}
- else if {_num} is 1:
- set {_p2} to loop-value
- delete {kitpvp.duel.waitingplayers.archer::%loop-index%}
- stop loop
- add 1 to {_num}
- send "&a対戦相手: &e%{_p2}%" to {_p1}
- send "&a対戦相手: &e%{_p1}%" to {_p2}
- startDuel({_p1}, {_p2}, "archer")
- if size of {kitpvp.duel.waitingplayers.gapple::*} >= 2:
- set {_num} to 0
- loop {kitpvp.duel.waitingplayers.gapple::*}:
- if {_num} is 0:
- set {_p1} to loop-value
- delete {kitpvp.duel.waitingplayers.gapple::%loop-index%}
- else if {_num} is 1:
- set {_p2} to loop-value
- delete {kitpvp.duel.waitingplayers.gapple::%loop-index%}
- stop loop
- add 1 to {_num}
- send "&a対戦相手: &e%{_p2}%" to {_p1}
- send "&a対戦相手: &e%{_p1}%" to {_p2}
- startDuel({_p1}, {_p2}, "gapple")
- if size of {kitpvp.duel.waitingplayers.combo::*} >= 2:
- set {_num} to 0
- loop {kitpvp.duel.waitingplayers.combo::*}:
- if {_num} is 0:
- set {_p1} to loop-value
- delete {kitpvp.duel.waitingplayers.combo::%loop-index%}
- else if {_num} is 1:
- set {_p2} to loop-value
- delete {kitpvp.duel.waitingplayers.combo::%loop-index%}
- stop loop
- add 1 to {_num}
- send "&a対戦相手: &e%{_p2}%" to {_p1}
- send "&a対戦相手: &e%{_p1}%" to {_p2}
- startDuel({_p1}, {_p2}, "combo")
- on command:
- command is "duel"
- cancel event
- if {kitpvp.playingstate.%player%} is not "not_playing":
- send "&cこのコマンドはロビーでのみ使用できます"
- else if {kitpvp.playingstate.%player%} is "not_playing":
- set {_command::*} to split full command by " "
- if size of {_command::*} is 2 or 3:
- if {_command::2} is "accept":
- if size of {_command::*} is 2:
- if {kitpvp.duel.receiveduel::%player%::*} is not set:
- send "&c1v1の申し込みは来ていません"
- else:
- send "&e%player%&aが1v1の申し込みを承認しました" to {kitpvp.duel.latestreceiveduel::%player%}
- remove {kitpvp.duel.latestreceiveduel::%player%} from {kitpvp.duel.receiveduel::%player%::*}
- delete {kitpvp.duel.sendduel::%{kitpvp.duel.latestreceiveduel::%player%}%}
- delete {kitpvp.duel.waitingaccept::%{kitpvp.duel.latestreceiveduel::%player%}%::%player%}
- startDuel(player, {kitpvp.duel.latestreceiveduel::%player%}, {kitpvp.duel.sendduelmode::%{kitpvp.duel.latestreceiveduel::%player%}%})
- delete {kitpvp.duel.sendduelmode::%{kitpvp.duel.latestreceiveduel::%player%}%}
- delete {kitpvp.duel.latestreceiveduel::%player%}
- else if size of {_command::*} is 3:
- set {_p2} to {_command::3} parsed as player
- if {_p2} is not set:
- send "&c%{_command::3}%はオフラインか存在しないプレイヤーです"
- else if {_p2} is player:
- send "&c自分自身と1v1をすることはできません"
- else if {_p2} is set:
- if {kitpvp.duel.receiveduel::%player%::*} do not contain {_p2}:
- send "&c%{_p2}%からの1v1の申し込みは来ていません"
- else if {kitpvp.duel.receiveduel::%player%::*} contain {_p2}:
- send "&e%player%&aが1v1の申し込みを承認しました" to {_p2}
- if {kitpvp.duel.latestreceiveduel::%player%} is {_p2}:
- delete {kitpvp.duel.latestreceiveduel::%player%}
- remove {_p2} from {kitpvp.duel.receiveduel::%player%::*}
- delete {kitpvp.duel.sendduel::%{_p2}%}
- delete {kitpvp.duel.waitingaccept::%{_p2}%::%player%}
- startDuel(player, {_p2}, {kitpvp.duel.sendduelmode::%{_p2}%})
- delete {kitpvp.duel.sendduelmode.%{_p2}%}
- else:
- if size of {_command::*} is 2:
- set {_p2} to {_command::2} parsed as player
- if {_p2} is not set:
- send "&c%{_command::2}%はオフラインか存在しないプレイヤーです"
- else if {_p2} is player:
- send "&c自分自身と1v1をすることはできません"
- else if {kitpvp.duel.receiveduel::%{_p2}%::*} contain player:
- send "&c既に%{_p2}%に1v1の申し込みを送信しています"
- else:
- open chest with 1 row named "&aDuel Menu§s§e§n§d" to player
- wait 1 tick
- set {_lore} to removeSuffix("§%join (split name of {_p2} by """") by ""§""%", "§")
- set slot 0 of player's current inventory to iron sword with nbt "{display:{Name:""&6KitPvP§p§2§:%{_lore}%""},HideFlags:2}"
- set slot 1 of player's current inventory to splash potion with nbt "{display:{Name:""&6PotPvP§p§2§:%{_lore}%""},Potion:""minecraft:strong_healing"",HideFlags:32}"
- set slot 2 of player's current inventory to player head with nbt "{display:{Name:""&6BuildUHC§p§2§:%{_lore}%""},SkullOwner:{Id:""e19442f7-4300-4004-b3cf-7d5ec3c72d0c"",Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvM2JiNjEyZWI0OTVlZGUyYzVjYTUxNzhkMmQxZWNmMWNhNWEyNTVkMjVkZmMzYzI1NGJjNDdmNjg0ODc5MWQ4In19fQ==""}]}}}"
- set slot 3 of player's current inventory to bow named "&6Archer§p§2§:%{_lore}%"
- set slot 4 of player's current inventory to enchanted golden apple named "&6Gapple§p§2§:%{_lore}%"
- set slot 5 of player's current inventory to diamond sword with nbt "{display:{Name:""&6Combo§p§2§:%{_lore}%""},HideFlags:2}"
- else:
- send "&cUsage: /duel <player> OR /duel accept [player]"
- else:
- send "&cUsage: /duel <player> OR /duel accept [player]"
- on inventory click:
- inventory type of player's current inventory is "CHEST"
- inventory name of player's current inventory is "&aDuel Menu§s§e§n§d"
- "%player's current inventory%" is "inventory of <none>"
- cancel event
- inventory type of clicked inventory is "CHEST"
- inventory name of clicked inventory is "&aDuel Menu§s§e§n§d"
- "%clicked inventory%" is "inventory of <none>"
- set {_bool} to false
- set {_strs::*} to split name of clicked item by "§p§2§:"
- set {_name} to {_strs::1}
- if clicked item is iron sword:
- {_name} is "&6KitPvP"
- set {_bool} to true
- set {_mode} to "kitpvp"
- if clicked item is splash potion:
- {_name} is "&6PotPvP"
- set {_bool} to true
- set {_mode} to "potpvp"
- if clicked item is player head:
- {_name} is "&6BuildUHC"
- set {_bool} to true
- set {_mode} to "builduhc"
- if clicked item is bow:
- {_name} is "&6Archer"
- set {_bool} to true
- set {_mode} to "archer"
- if clicked item is enchanted golden apple:
- {_name} is "&6Gapple"
- set {_bool} to true
- set {_mode} to "gapple"
- if clicked item is diamond sword:
- {_name} is "&6Combo"
- set {_bool} to true
- set {_mode} to "combo"
- {_bool} is true
- close player's inventory
- set {_p2name} to {_strs::2}
- replace "§" in {_p2name} with ""
- loop all players:
- name of loop-player is {_p2name}
- set {_p2} to loop-player
- stop loop
- if {_p2} is not set:
- send "&c%{_p2name}%はオフラインです"
- else:
- play sound "BLOCK_NOTE_PLING" to player with volume 1 and pitch 5
- set {kitpvp.duel.sendduel::%player%} to {_p2}
- set {kitpvp.duel.sendduelmode::%player%} to {_mode}
- send "&e%{_p2}%&aに1v1の申し込みを送信しました%nl%&aモード: &e%removeColorCode({_name})%"
- set {kitpvp.duel.latestreceiveduel::%{_p2}%} to player
- set {kitpvp.duel.receiveduel::%{_p2}%::%player%} to player
- send "&e%player%&aから1v1の申し込みがありました%nl%&aモード: &e%removeColorCode({_name})%" to {_p2}
- send "&a10秒以内に&e&n/duel accept&aと打つことで1v1を開始できます" to {_p2}
- set {_packet} to new play_server_chat packet
- set "chatcomponent" pjson 0 of {_packet} to "{""extra"":[{""text"":""ここをクリックで承認"",""color"":""gold"",""bold"":true,""clickEvent"":{""action"":""run_command"",""value"":""/duel accept %player%""}}],""text"":""""}" parsed as jsonobject
- set byte pnum 0 of {_packet} to 0
- send {_p2} packet {_packet}
- set {kitpvp.duel.waitingaccept::%player%::%{_p2}%} to 1
- wait 10 second
- {kitpvp.duel.waitingaccept::%player%::%{_p2}%} is 1
- if {kitpvp.duel.latestreceiveduel::%{_p2}%} is player:
- delete {kitpvp.duel.latestreceiveduel::%{_p2}%}
- remove player from {kitpvp.duel.receiveduel::%{_p2}%::*}
- delete {kitpvp.duel.sendduel::%player%}
- delete {kitpvp.duel.waitingaccept::%player%::%{_p2}%}
- send "&a10秒経っても承認されなかったため1v1の申し込みは無効になりました"
- send "&a10秒経っても承認されなかったため1v1の申し込みは無効になりました" to {_p2}
- on tab complete:
- set {_strs::*} to split event-string by " "
- {_strs::1} is "/duel"
- if size of {_strs::*} is 2:
- if {_strs::2} is "":
- loop all players:
- add name of loop-player to completions
- else:
- loop all players:
- first length of {_strs::2} characters of name of loop-player is {_strs::2}
- add name of loop-player to completions
- else if size of {_strs::*} is 3:
- {_strs::2} is "accept"
- if {_strs::3} is "":
- loop all players:
- add name of loop-player to completions
- else:
- loop all players:
- first length of {_strs::3} characters of name of loop-player is {_strs::3}
- add name of loop-player to completions
- function startDuel(p1: player, p2: player, mode: string):
- {_p1} is not {_p2}
- {_mode} is "gapple" or "potpvp" or "combo" or "builduhc" or "archer" or "kitpvp"
- loop {kitpvp.duel.arena::*}:
- {kitpvp.duel.using::%loop-index%} is not set
- set {_usablearenas::%loop-index%} to loop-value
- if {_usablearenas::*} is not set:
- send "&c使用可能なアリーナが存在しなかったため1v1を開始できませんでした" to {_p1}
- send "&c使用可能なアリーナが存在しなかったため1v1を開始できませんでした" to {_p2}
- leaveDUEL({_p1})
- leaveDUEL({_p2})
- teleportSpawn({_p1})
- teleportSpawn({_p2})
- else if {_usablearenas::*} is set:
- set level of {_p1} to 0
- set level progress of {_p1} to 0
- set level of {_p2} to 0
- set level progress of {_p2} to 0
- clear {_p1}'s inventory
- clear {_p2}'s inventory
- if {_mode} is "kitpvp":
- set slot 0 of {_p1}'s inventory to chest named "&aKit Select" with lore "&d&oUndroppable"
- set slot 0 of {_p2}'s inventory to chest named "&aKit Select" with lore "&d&oUndroppable"
- set selected hotbar slot of {_p1} to 0
- set selected hotbar slot of {_p2} to 0
- set {_arena} to random element out of {_usablearenas::*}
- set {kitpvp.duel.using::%{_arena}%} to 1
- set {kitpvp.duel.duelmode::%{_arena}%} to {_mode}
- teleport {_p1} to {kitpvp.duel.lobby}
- teleport {_p2} to {kitpvp.duel.lobby}
- set {kitpvp.playingstate.%{_p1}%} to "waiting_duel"
- set {kitpvp.playingstate.%{_p2}%} to "waiting_duel"
- wipe {_p1} sidebar
- wipe {_p2} sidebar
- set {kitpvp.duel.usingarena::%{_p1}%} to {_arena}
- set {kitpvp.duel.usingarena::%{_p2}%} to {_arena}
- set {kitpvp.duel.opponent::%{_p1}%} to {_p2}
- set {kitpvp.duel.opponent::%{_p2}%} to {_p1}
- send "&e15秒後&aに試合を開始します" to {_p1}
- send "&e15秒後&aに試合を開始します" to {_p2}
- play sound "UI_BUTTON_CLICK" to {_p1} with volume 1 and pitch 15
- play sound "UI_BUTTON_CLICK" to {_p2} with volume 1 and pitch 15
- wait 5 second
- {kitpvp.duel.using::%{_arena}%} is 1
- send "&e10秒後&aに試合を開始します" to {_p1}
- send "&e10秒後&aに試合を開始します" to {_p2}
- play sound "UI_BUTTON_CLICK" to {_p1} with volume 1 and pitch 15
- play sound "UI_BUTTON_CLICK" to {_p2} with volume 1 and pitch 15
- wait 5 second
- loop 5 times:
- {kitpvp.duel.using::%{_arena}%} is 1
- send "&e%6-loop-number%秒後&aに試合を開始します" to {_p1}
- send "&e%6-loop-number%秒後&aに試合を開始します" to {_p2}
- play sound "UI_BUTTON_CLICK" to {_p1} with volume 1 and pitch 15
- play sound "UI_BUTTON_CLICK" to {_p2} with volume 1 and pitch 15
- wait 1 second
- {kitpvp.duel.using::%{_arena}%} is 1
- if random integer between 0 and 1 is 1:
- teleport {_p1} to {kitpvp.duel.tp1::%{_arena}%}
- teleport {_p2} to {kitpvp.duel.tp2::%{_arena}%}
- else:
- teleport {_p1} to {kitpvp.duel.tp2::%{_arena}%}
- teleport {_p2} to {kitpvp.duel.tp1::%{_arena}%}
- play sound "BLOCK_NOTE_PLING" to {_p1} with volume 1 and pitch 5
- play sound "BLOCK_NOTE_PLING" to {_p2} with volume 1 and pitch 5
- send "&a開始しました" to {_p1}
- send "&a開始しました" to {_p2}
- set {kitpvp.playingstate.%{_p1}%} to "playing_duel"
- set {kitpvp.playingstate.%{_p2}%} to "playing_duel"
- set {kitpvp.duel.matchtime::%{_arena}%} to 18000
- set selected hotbar slot of {_p1} to 0
- set selected hotbar slot of {_p2} to 0
- updateSideBar("duel", {_p1})
- updateSideBar("duel", {_p2})
- if {_mode} is "kitpvp":
- set {_uuid} to UUID of {_p1}
- loop 41 times:
- set {_slot} to loop-number - 1
- set slot {_slot} of {_p1}'s inventory to {kititems.%{kitpvp.lastselectedkit.%{_uuid}%}%::%{_slot}%}
- set {_uuid} to UUID of {_p2}
- loop 41 times:
- set {_slot} to loop-number - 1
- set slot {_slot} of {_p2}'s inventory to {kititems.%{kitpvp.lastselectedkit.%{_uuid}%}%::%{_slot}%}
- else:
- set max health of {_p1} to 10
- set max health of {_p2} to 10
- set health of {_p1} to 10
- set health of {_p2} to 10
- loop 41 times:
- set {_slot} to loop-number - 1
- set slot {_slot} of {_p1}'s inventory to {duelkit.%{_mode}%::%{_slot}%}
- set slot {_slot} of {_p2}'s inventory to {duelkit.%{_mode}%::%{_slot}%}
- on damage of player:
- {kitpvp.playingstate.%victim%} is "playing_duel"
- {kitpvp.duel.duelmode::%{kitpvp.duel.usingarena::%victim%}%} is "combo"
- set damage delay of victim to 0 tick
- on quit:
- if {kitpvp.playingstate.%player%} is "waiting_duel":
- send "&c対戦相手がサーバーから退出したためカウントダウンを中断しました" to {kitpvp.duel.opponent::%player%}
- teleportSpawn({kitpvp.duel.opponent::%player%})
- play sound "UI_BUTTON_CLICK" to {kitpvp.duel.opponent::%player%} with volume 1 and pitch 5
- delete {kitpvp.duel.using::%{kitpvp.duel.usingarena::%player%}%}
- delete {kitpvp.duel.duelmode::%{kitpvp.duel.usingarena::%player%}%}
- delete {kitpvp.duel.usingarena::%{kitpvp.duel.opponent::%player%}%}
- delete {kitpvp.duel.opponent::%{kitpvp.duel.opponent::%player%}%}
- delete {kitpvp.duel.usingarena::%player%}
- delete {kitpvp.duel.opponent::%player%}
- else if {kitpvp.playingstate.%player%} is "playing_duel":
- broadcast "&e%{kitpvp.duel.opponent::%player%}%&aが&e%player%&aとの1v1で勝利しました"
- loop all entities:
- loop-entity is dropped item or projectile
- loop-entity's world is {kitpvp.duel.tp1::%{kitpvp.duel.usingarena::%player%}%}'s world
- x-coordinate of loop-entity is between x-coordinate of {kitpvp.duel.pos1::%{kitpvp.duel.usingarena::%player%}%} and x-coordinate of {kitpvp.duel.pos2::%{kitpvp.duel.usingarena::%player%}%}
- y-coordinate of loop-entity is between y-coordinate of {kitpvp.duel.pos1::%{kitpvp.duel.usingarena::%player%}%} and y-coordinate of {kitpvp.duel.pos2::%{kitpvp.duel.usingarena::%player%}%}
- z-coordinate of loop-entity is between z-coordinate of {kitpvp.duel.pos1::%{kitpvp.duel.usingarena::%player%}%} and z-coordinate of {kitpvp.duel.pos2::%{kitpvp.duel.usingarena::%player%}%}
- kill loop-entity
- set {_session} to new editsession in world "%player's world%" with limit -1
- set {_items::*} to "fire" parsed as item
- set {_id} to 8
- loop 4 times:
- set {_data} to 0
- loop 10 times:
- add getItemStackFromID({_id}, {_data}) to {_items::*}
- add 1 to {_data}
- add 1 to {_id}
- replace {_items::*} between {kitpvp.duel.pos1::%{kitpvp.duel.usingarena::%player%}%} and {kitpvp.duel.pos2::%{kitpvp.duel.usingarena::%player%}%} with air using {_session}
- loop {kitpvp.duel.playerplacedblocks.%{kitpvp.duel.usingarena::%player%}%::*}:
- set block at {kitpvp.duel.playerplacedblocks.%{kitpvp.duel.usingarena::%player%}%::%loop-index%} to air
- delete {kitpvp.duel.playerplacedblocks.%{kitpvp.duel.usingarena::%player%}%::%loop-index%}
- teleportSpawn({kitpvp.duel.opponent::%player%})
- send {kitpvp.duel.opponent::%player%} title "&6&lVICTORY" for 2 second with 0 tick fade in and 0.5 second fade out
- giveReward({kitpvp.duel.opponent::%player%}, 30, "Victory")
- send "&a+30 EXP (Victory)" to {kitpvp.duel.opponent::%player%}
- play sound "ENTITY_PLAYER_LEVELUP" to {kitpvp.duel.opponent::%player%} with volume 1 and pitch 5
- delete {kitpvp.duel.using::%{kitpvp.duel.usingarena::%player%}%}
- delete {kitpvp.duel.duelmode::%{kitpvp.duel.usingarena::%player%}%}
- delete {kitpvp.duel.matchtime::%{kitpvp.duel.usingarena::%player%}%}
- delete {kitpvp.duel.usingarena::%{kitpvp.duel.opponent::%player%}%}
- delete {kitpvp.duel.opponent::%{kitpvp.duel.opponent::%player%}%}
- delete {kitpvp.duel.usingarena::%player%}
- delete {kitpvp.duel.opponent::%player%}
- on death of player:
- {kitpvp.playingstate.%victim%} is "playing_duel"
- set death message to ""
- broadcast "&e%{kitpvp.duel.opponent::%victim%}%&aが&e%victim%&aとの1v1で勝利しました"
- loop all entities:
- loop-entity is a dropped item or a projectile
- loop-entity's world is {kitpvp.duel.tp1::%{kitpvp.duel.usingarena::%victim%}%}'s world
- x-coordinate of loop-entity is between x-coordinate of {kitpvp.duel.pos1::%{kitpvp.duel.usingarena::%victim%}%} and x-coordinate of {kitpvp.duel.pos2::%{kitpvp.duel.usingarena::%victim%}%}
- y-coordinate of loop-entity is between y-coordinate of {kitpvp.duel.pos1::%{kitpvp.duel.usingarena::%victim%}%} and y-coordinate of {kitpvp.duel.pos2::%{kitpvp.duel.usingarena::%victim%}%}
- z-coordinate of loop-entity is between z-coordinate of {kitpvp.duel.pos1::%{kitpvp.duel.usingarena::%victim%}%} and z-coordinate of {kitpvp.duel.pos2::%{kitpvp.duel.usingarena::%victim%}%}
- kill loop-entity
- set {_session} to new editsession in world "%player's world%" with limit -1
- set {_items::*} to "fire" parsed as item
- set {_id} to 8
- loop 4 times:
- set {_data} to 0
- loop 10 times:
- add getItemStackFromID({_id}, {_data}) to {_items::*}
- add 1 to {_data}
- add 1 to {_id}
- replace {_items::*} between {kitpvp.duel.pos1::%{kitpvp.duel.usingarena::%victim%}%} and {kitpvp.duel.pos2::%{kitpvp.duel.usingarena::%victim%}%} with air using {_session}
- loop {kitpvp.duel.playerplacedblocks.%{kitpvp.duel.usingarena::%victim%}%::*}:
- set block at {kitpvp.duel.playerplacedblocks.%{kitpvp.duel.usingarena::%victim%}%::%loop-index%} to air
- delete {kitpvp.duel.playerplacedblocks.%{kitpvp.duel.usingarena::%victim%}%::%loop-index%}
- teleportSpawn({kitpvp.duel.opponent::%victim%})
- send {kitpvp.duel.opponent::%victim%} title "&6&lVICTORY" for 2 second with 0 tick fade in and 0.5 second fade out
- giveReward({kitpvp.duel.opponent::%victim%}, 30, "Victory")
- play sound "ENTITY_PLAYER_LEVELUP" to {kitpvp.duel.opponent::%victim%} with volume 1 and pitch 5
- delete {kitpvp.duel.using::%{kitpvp.duel.usingarena::%victim%}%}
- delete {kitpvp.duel.duelmode::%{kitpvp.duel.usingarena::%victim%}%}
- delete {kitpvp.duel.matchtime::%{kitpvp.duel.usingarena::%victim%}%}
- delete {kitpvp.duel.usingarena::%{kitpvp.duel.opponent::%victim%}%}
- delete {kitpvp.duel.opponent::%{kitpvp.duel.opponent::%victim%}%}
- delete {kitpvp.duel.usingarena::%victim%}
- delete {kitpvp.duel.opponent::%victim%}
- wait 19 tick
- force victim to respawn
- teleportSpawn(victim)
- every tick:
- loop {kitpvp.duel.matchtime::*}:
- {kitpvp.duel.matchtime::%loop-index%} >= 1
- remove 1 from {kitpvp.duel.matchtime::%loop-index%}
- if mod({kitpvp.duel.matchtime::%loop-index%}, 20) is 0:
- loop all players:
- {kitpvp.duel.usingarena::%loop-player%} is loop-index
- updateSideBar("duel", loop-player)
- {kitpvp.duel.matchtime::%loop-index%} is 0
- loop all players:
- {kitpvp.duel.usingarena::%loop-player%} is loop-index
- send loop-player title "&9&lDRAW" for 2 second with 0 tick fade in and 0.5 second fade out
- giveReward(loop-player, 15, "Draw")
- send "&a+15 EXP (Draw)" to loop-player
- delete {kitpvp.duel.usingarena::%loop-player%}
- delete {kitpvp.duel.opponent::%loop-player%}
- teleportSpawn(loop-player)
- loop all entities:
- loop-entity is dropped item or projectile
- loop-entity's world is {kitpvp.duel.tp1::%loop-index%}'s world
- x-coordinate of loop-entity is between x-coordinate of {kitpvp.duel.pos1::%{_arena}%} and x-coordinate of {kitpvp.duel.pos2::%{_arena}%}
- y-coordinate of loop-entity is between y-coordinate of {kitpvp.duel.pos1::%{_arena}%} and y-coordinate of {kitpvp.duel.pos2::%{_arena}%}
- z-coordinate of loop-entity is between z-coordinate of {kitpvp.duel.pos1::%{_arena}%} and z-coordinate of {kitpvp.duel.pos2::%{_arena}%}
- kill loop-entity
- delete {kitpvp.duel.using::%loop-index%}
- delete {kitpvp.duel.duelmode::%loop-index%}
- delete {kitpvp.duel.matchtime::%loop-index%}
- set {_session} to new editsession in world "%{kitpvp.duel.tp1::%loop-index%}'s world%" with limit -1
- set {_items::*} to "fire" parsed as item
- set {_id} to 8
- loop 4 times:
- set {_data} to 0
- loop 10 times:
- add getItemStackFromID({_id}, {_data}) to {_items::*}
- add 1 to {_data}
- add 1 to {_id}
- replace {_items::*} between {kitpvp.duel.pos1::%loop-index%} and {kitpvp.duel.pos2::%loop-index%} with air using {_session}
- wait 1 tick
- loop {kitpvp.duel.playerplacedblocks.%loop-index%::*}:
- set block at {kitpvp.duel.playerplacedblocks.%loop-index-1%::%loop-index-2%} to air
- delete {kitpvp.duel.playerplacedblocks.%loop-index-1%::%loop-index-2%}
- on click:
- id of player's tool is 397
- durability of player's tool is 3
- name of player's tool is "&6Golden Head"
- cancel event
- set {_lastuse} to metadata value "GoldenHeadLastUse" of player
- if check [{_lastuse} is not set] or check [unix timestamp of now - {_lastuse} >= 1]:
- play sound "ENTITY_GENERIC_EAT" to player with volume 1 and pitch 5
- execute console command "execute %player% ~ ~ ~ effect @s 1 10 0"
- execute console command "execute %player% ~ ~ ~ effect @s 10 5 2"
- execute console command "execute %player% ~ ~ ~ effect @s 22 120 0"
- player's gamemode is survival or adventure
- remove 1 from item amount of player's tool
- set metadata value "GoldenHeadLastUse" of player to unix timestamp of now
- else:
- send "&c使用間隔が短すぎます" to player
- command /setduelkititems [<text>]:
- permission: kitpvp.admin
- permission message: &cYou do not have permission to use this command.
- trigger:
- if arg is not set:
- send "&cUsage: /setduelkititems <DuelMode>"
- else if arg is not "potpvp" or "builduhc" or "gapple" or "archer" or "combo":
- send "&cUsage: /setduelkititems <DuelMode>"
- else:
- if arg is "potpvp":
- set {_duelmodename} to "PotPvP"
- if arg is "builduhc":
- set {_duelmodename} to "BuildUHC"
- if arg is "gapple":
- set {_duelmodename} to "Gapple"
- if arg is "archer":
- set {_duelmodename} to "Archer"
- if arg is "combo":
- set {_duelmodename} to "Combo"
- loop 41 times:
- set {_slot} to loop-number - 1
- set {duelkit.%arg%::%{_slot}%} to slot {_slot} of player's inventory
- send "&e%{_duelmodename}%&aのキットを設定しました"
- command /setduelkit <text>:
- permission: kitpvp.admin
- permission message: &cYou do not have permission to use this command.
- trigger:
- {duelkit.%arg%::*} is set
- loop 41 times:
- set {_slot} to loop-number - 1
- set slot {_slot} of player's inventory to {duelkit.%arg%::%{_slot}%}
- on place:
- player's gamemode is not creative
- {kitpvp.playingstate.%player%} is "playing_duel"
- {kitpvp.duel.duelmode::%{kitpvp.duel.usingarena::%player%}%} is "builduhc"
- add location of event-block to {kitpvp.duel.playerplacedblocks.%{kitpvp.duel.usingarena::%player%}%::*}
- on mine:
- {kitpvp.playingstate.%player%} is "playing_duel"
- {kitpvp.duel.duelmode::%{kitpvp.duel.usingarena::%player%}%} is "builduhc"
- {kitpvp.duel.playerplacedblocks.%{kitpvp.duel.usingarena::%player%}%::*} contain location of event-block
- drop event-block at location 0.5 meter east location 0.5 meter above location 0.5 meter south location of event-block
- on break:
- {kitpvp.playingstate.%player%} is "playing_duel"
- {kitpvp.duel.duelmode::%{kitpvp.duel.usingarena::%player%}%} is "builduhc"
- {kitpvp.duel.playerplacedblocks.%{kitpvp.duel.usingarena::%player%}%::*} contain location of event-block
- remove location of event-block from {kitpvp.duel.playerplacedblocks.%{kitpvp.duel.usingarena::%player%}%::*}
- on form:
- event-block is cobblestone or stone
- loop {kitpvp.duel.using::*}:
- x-coordinate of event-block is between x-coordinate of {kitpvp.duel.pos1::%loop-index%} and x-coordinate of {kitpvp.duel.pos2::%loop-index%}
- y-coordinate of event-block is between y-coordinate of {kitpvp.duel.pos1::%loop-index%} and y-coordinate of {kitpvp.duel.pos2::%loop-index%}
- z-coordinate of event-block is between z-coordinate of {kitpvp.duel.pos1::%loop-index%} and z-coordinate of {kitpvp.duel.pos2::%loop-index%}
- add location of event-block to {kitpvp.duel.playerplacedblocks.%loop-index%::*}
- on rightclick with ender pearl:
- {kitpvp.playingstate.%player%} is "playing_duel"
- {kitpvp.duel.duelmode::%{kitpvp.duel.usingarena::%player%}%} is "potpvp"
- if {enderpearlcooldown.%player%} is not set:
- set {enderpearlcooldown.%player%} to 300
- else if {enderpearlcooldown.%player%} is set:
- send "&aCooldown: &c%ceil({enderpearlcooldown.%player%}/20)% seconds"
- cancel event
- every tick:
- loop all players:
- {enderpearlcooldown.%loop-player%} >= 1
- remove 1 from {enderpearlcooldown.%loop-player%}
- set level of loop-player to ceil({enderpearlcooldown.%loop-player%}/20)
- set level progress of loop-player to {enderpearlcooldown.%loop-player%}/300
- {enderpearlcooldown.%loop-player%} is 0
- delete {enderpearlcooldown.%loop-player%}
Add Comment
Please, Sign In to add comment