# PotPVP Core Plugin options: prefix: "%{prefix}%" config: Config.yml configdir: "plugins/PotPVP/Config.yml" reportsdir: "plugins/PotPVP/Reports.yml" folderdir: "plugins/PotPVP" logdir: "plugins/PotPVP/Log.yml" on player join: has permission "PotPVP.admin" variables: {offping} = 500 {maxping} = 250 {medping} = 200 {lowping} = 100 {noping} = 50 {range} = 3.7 command /potpvp [] []: permission: PotPVP.admin trigger: if arg 1 is not set: message "%{prefix}% &ainvalid usage: &e/PotPVP > > " if arg 1 is "disable": if arg 2 is not set: message "%{prefix}% &ainvalid usage: &e/PotPVP >" if arg 2 is "Reach": if file {@configdir} doesn't exists: message "%{prefix}% &cAn error has occured!" message "&cPlease do &e/autofix " set "Reach" to "false" in yaml file {@configdir} set {potpvp.reach} to false message "%{prefix}% &cDisabled the &c&lReach &ccheck!" if arg 2 is "KillAura": if file {@configdir} doesn't exists: message "%{prefix}% &cAn error has occured!" message "&cPlease do &e/autofix " set "KillAura" to "false" in yaml file {@configdir} set {potpvp.killaura} to false message "%{prefix}% &cDisabled the &c&lKillAura &ccheck!" if arg 2 is "Flight": if file {@configdir} doesn't exists: message "%{prefix}% &cAn error has occured!" message "&cPlease do &e/autofix " set "Flight" to "false" in yaml file {@configdir} set {potpvp.flight} to false message "%{prefix}% &cDisabled the &c&lFlight &ccheck!" if arg 2 is "Speed": if file {@configdir} doesn't exists: message "%{prefix}% &cAn error has occured!" message "&cPlease do &e/autofix " set "Speed" to "false" in yaml file {@configdir} set {potpvp.speed} to false message "%{prefix}% &cDisabled the &c&lSpeed &ccheck!" if arg 2 is "NoSlow": if file {@configdir} doesn't exists: message "%{prefix}% &cAn error has occured!" message "&cPlease do &e/autofix " set "NoSlow" to "false" in yaml file {@configdir} set {potpvp.noslow} to false message "%{prefix}% &cDisabled the &c&lNoSlow &ccheck!" if arg 2 is "Debug": set {potpvp.debug} to false message "%{prefix}% &cDisabled &c&lDebug &cMode!" if arg 1 is "enable": if arg 2 is not set: message "%{prefix}% &ainvalid usage: &e/PotPVP >" if arg 2 is "Reach": if file {@configdir} doesn't exists: message "%{prefix}% &cAn error has occured!" message "&cPlease do &e/autofix " set "Reach" to "true" in yaml file {@configdir} set {potpvp.reach} to true message "%{prefix}% &aEnabled the &a&lReach &acheck!" if arg 2 is "KillAura": if file {@configdir} doesn't exists: message "%{prefix}% &cAn error has occured!" message "&cPlease do &e/autofix " set "KillAura" to "true" in yaml file {@configdir} set {potpvp.killaura} to true message "%{prefix}% &aEnabled the &a&lKillAura &acheck!" if arg 2 is "Flight": if file {@configdir} doesn't exists: message "%{prefix}% &cAn error has occured!" message "&cPlease do &e/autofix " set "Flight" to "true" in yaml file {@configdir} set {potpvp.flight} to true message "%{prefix}% &aEnabled the &a&lFlight &acheck!" if arg 2 is "Speed": if file {@configdir} doesn't exists: message "%{prefix}% &cAn error has occured!" message "&cPlease do &e/autofix " set "Speed" to "true" in yaml file {@configdir} set {potpvp.speed} to true message "%{prefix}% &aEnabled the &a&lSpeed &acheck!" if arg 2 is "NoSlow": if file {@configdir} doesn't exists: message "%{prefix}% &cAn error has occured!" message "&cPlease do &e/autofix " set "NoSlow" to "true" in yaml file {@configdir} set {potpvp.noslow} to true message "%{prefix}% &aEnabled the &a&lNoSlow &acheck!" if arg 2 is "Debug": set {potpvp.debug} to true message "%{prefix}% &aEnabled &a&lDebug &aMode!" if arg 1 is "reload": if folder "plugins/PotPVP" doesn't exists: create folder "plugins/PotPVP" wait 25 ticks create file {@reportsdir} create file {@configdir} create file {@logdir} wf "Reach: 'true'" to {@configdir} wf "KillAura: 'true'" to {@configdir} wf "Flight: 'true'" to {@configdir} wf "Speed: 'true'" to {@configdir} wf "NoSlow: 'true'" to {@configdir} wf "Prefix: '%{prefix}%'" to {@configdir} set {prefix} to colored value "Prefix" get of {@configdir} set {prefix} to colored value "Prefix" get of {@configdir} set {potpvp.killaura} to single value "Kill Aura Checks" get of "plugins/PotPVP/config.yml" if file {@configdir} doesn't exists: create file {@configdir} if file {@reportsdir} doesn't exists: create file {@reportsdir} if file {@logdir} doesn't exists: create file {@logdir} message "&6Pot&f&lPVP: &eSuccessfully reloaded!" on script load: if folder "plugins/PotPVP" doesn't exists: create folder "plugins/PotPVP" wait 25 ticks create file {@reportsdir} create file {@configdir} create file {@logdir} wf "Reach: 'true'" to {@configdir} wf "KillAura: 'true'" to {@configdir} wf "Flight: 'true'" to {@configdir} wf "Speed: 'true'" to {@configdir} wf "NoSlow: 'true'" to {@configdir} wf "Prefix: '%{prefix}%'" to {@configdir} set {prefix} to "&6Pot&f&lPVP: " set {prefix} to colored value "Prefix" get of {@configdir} set {potpvp.killaura} to single value "KillAura" get of "plugins/PotPVP/Config.yml" set {potpvp.reach} to single value "Reach" get of "plugins/PotPVP/Config.yml" set {potpvp.flight} to single value "Flight" get of "plugins/PotPVP/Config.yml" if file {@configdir} doesn't exists: create file {@configdir} if file {@reportsdir} doesn't exists: create file {@reportsdir} if file {@logdir} doesn't exists: create file {@logdir} on player drink of potion: wait 1 tick make console execute command "/clear %player% glass_bottle" command /report [] []: trigger: if arg 1 is not set: message "%{prefix}% &ainvalid usage: &e/report " if arg 2 is set: message "%{prefix}% &eThanks for reporting!" wf "%player% thinks that %arg 1% is using %arg 2% [%now%]" to {@reportsdir} wf "" to {@reportsdir} loop all players: if loop-player has permission "potpvp.staff": send "%{prefix}% &a%player% ðinks that &b%arg 1% &eis using &f&l%arg 2% &b&l[%now%]" to loop-player stop if file {@reportsdir} doesn't exists: message "%{prefix}% &cAn error has occured while logging your report" message "&cPlease contact an Admin or do &e/autofix " if arg 1 is "%player%": message "%{prefix}% &aYou may not report yourself!" stop on chat: if message contains "shit" or "fuck" or "gay" or "idiot" or "butt" or "shit" or "fack" or "bastard" or "mother fucker" or "fucker" or "dick" or "cock" or "bitch" or "cunt" or "fuck off" or "nigga" or "nigger" or "stfu" or "shut the fuck up" or "fck" or "what the fuck" or "fuck you" or "fok" or "homo" or "asf" or "pennis" or "rape" or "porn" or "prn" or "peni" or "sex" or "piss" or "ass" or "sht" or "feg" or "tits" or "fyc" or "anal" or "fap" or "ffs" or "sx" or "aids" or "mofo" or "niggah" or "lesbian" or "ngga" or "dumbass" or "dumb" or "fucking" or "pussy" or "pussies" or "cancer": if player has permission "potpvp.bypass": stop cancel the event send "&8&m-------------------------" send "&c&lPlease do not swear" send "&8&m-------------------------" loop all players: if loop-player has permission "potpvp.staff": send "&e&o%player% is swearing!" to loop-player stop command /setmainspawn: permission: potpvp.admin permission message: "%{prefix}% &cNo permission" trigger: set {Hub::hub} to location of player message "%{prefix}% &aMain Spawn set!" on join: teleport player to {Hub::Hub} on damage of player: if attacker doesn't have permission "potpvp.bypass": attacker is a player projectile doesn't exist if attacker's gamemode is survival or adventure: if {potpvp.reach} is true: if attacker's ping is less than 201: if distance between attacker and victim is greater than 4.8: loop all players: if loop-player has permission "potpvp.staff": message "%{prefix}% &e&l%attacker% &c(Reach) (Range: %distance between attacker and victim% Blocks) (Ping: %attacker's ping%)" to loop-player if {potpvp.debug} is true: set {_facing} to attacker's horizontal facing set {_tool} to attacker's tool set {_health} to attacker's health set {_damage} to damage set {_p} to attacker's ping message "&6&m-----------------------------------" to loop-player message "&fFacing: &7{_facing}" to loop-player message "&fItem: &7{_tool}" to loop-player message "&fHealth: &7{_health}" to loop-player message "&fDamage: &7{_damage}" to loop-player message "&6&m-----------------------------------" to loop-player if attacker's ping is less than 251: if distance between attacker and victim is greater than 5.6: loop all players: if loop-player has permission "potpvp.staff": message "%{prefix}% &e&l%attacker% &c(Reach) (Range: %distance between attacker and victim% Blocks) (Ping: %attacker's ping%)" to loop-player if {potpvp.debug} is true: set {_facing} to attacker's horizontal facing set {_tool} to attacker's tool set {_health} to attacker's health set {_damage} to damage set {_p} to attacker's ping message "&6&m-----------------------------------" to loop-player message "&fFacing: &7{_facing}" to loop-player message "&fItem: &7{_tool}" to loop-player message "&fHealth: &7{_health}" to loop-player message "&fDamage: &7{_damage}" to loop-player message "&6&m-----------------------------------" to loop-player if attacker's ping is more than 251: stop if attacker's ping is less than 101: if distance between attacker and victim is greater than 4.2: loop all players: if loop-player has permission "potpvp.staff": message "%{prefix}% &e&l%attacker% &c(Reach) (Range: %distance between attacker and victim% Blocks) (Ping: %attacker's ping%)" to loop-player if {potpvp.debug} is true: set {_facing} to attacker's horizontal facing set {_tool} to attacker's tool set {_health} to attacker's health set {_damage} to damage set {_p} to attacker's ping message "&6&m-----------------------------------" to loop-player message "&fFacing: &7{_facing}" to loop-player message "&fItem: &7{_tool}" to loop-player message "&fHealth: &7{_health}" to loop-player message "&fDamage: &7{_damage}" to loop-player message "&6&m-----------------------------------" to loop-player if attacker's ping is less than 51: if distance between attacker and victim is greater than 3.4: loop all players: if loop-player has permission "potpvp.staff": message "%{prefix}% &e&l%attacker% &c(Reach) (Range: %distance between attacker and victim% Blocks) (Ping: %attacker's ping%)" to loop-player if {potpvp.debug} is true: set {_facing} to attacker's horizontal facing set {_tool} to attacker's tool set {_health} to attacker's health set {_damage} to damage set {_p} to attacker's ping message "&6&m-----------------------------------" to loop-player message "&fFacing: &7{_facing}" to loop-player message "&fItem: &7{_tool}" to loop-player message "&fHealth: &7{_health}" to loop-player message "&fDamage: &7{_damage}" to loop-player message "&6&m-----------------------------------" to loop-player else: stop on player drop of diamond sword or iron axe: if player has permission "potpvp.drop": stop else: cancel event message "&cYou aren't allowed to drop your main weapon!" wait 1 tick on damage of player: attacker is a player projectile doesn't exist wf "LOG (ATTACK): %attacker% vs %victim%, REACH: %distance between attacker and victim%, PINGS: ATTACKER = %attacker's ping% VICTIM = %victim's ping% TIME: %now%" to {@logdir} on any movement: if player doesn't have permission "potpvp.bypass": if {potpvp.noslow} is true: if player is blocking: if player is sprinting: set {_reblock} to block at player wait 10 ticks delete {_reblock} if player is blocking: if player is sprinting: set {_reblock} to block at player wait 10 ticks if player is blocking: if player is sprinting: teleport player to {_reblock} loop all players: if loop-player has permission "potpvp.staff": message "%{prefix}% &e&l%player% &c(NoSlow) (Ping: %player's ping%)" to loop-player if {potpvp.debug} is true: message "&6&m-----------------------------------" to loop-player message "&fPing: &7%player's ping%" to loop-player message "&fAltitude: &7%player's altitude%" to loop-player message "&6&m-----------------------------------" to loop-player on any movement: if {potpvp.flight} is true: if player's ping < {maxping}: if player is not riding: if player's flight mode is false: if player doesn't have permission "potpvp.bypass": if player's gamemode is survival or adventure: if player's health < player's max health: if block under player is air: set {_b} to block under player if block under {_b} is air: set {_y1} to y-coordinates of player if block behind {_b} is air: if block 1 meter south of {_b} is air: if block 1 meter west of {_b} is air: if block 1 meter east of {_b} is air: if block 1 meter north of {_b} is air: wait 10 ticks set {_y2} to y-coordinates of player if {_y2} is higher than or equal to {_y1}: if difference between {_y2} and {_y1} is higher than 2.1: push player downwards at speed 1.2 teleport player to {_b} wait 1 tick teleport player to {_b} wait 1 tick teleport player to {_b} set {_p} to player's ping set {_block} to block under player wf "LOG (FLIGHT): ALTITUDE: %player's altitude%, PINGS: %player's ping% TIME: %now%" to {@logdir} loop all players: if loop-player has permission "potpvp.staff": message "%{prefix}% &e&l%player% &c(Flight) (Ping: %player's ping%)" to loop-player if {potpvp.debug} is true: message "&6&m-----------------------------------" to loop-player message "&fPing: &7%player's ping%" to loop-player message "&fAltitude: &7%player's altitude%" to loop-player message "&6&m-----------------------------------" to loop-player on any movement: if {potpvp.flight} is true: if player's ping < {maxping}: if player is not riding: if player doesn't have permission "potpvp.bypass": if player's gamemode is survival or adventure: if player's flight mode is false: set {_b} to block under player if block under {_b} is air: set {_x1} to x-coordinates of player set {_z1} to z-coordinates of player set {_y1} to y-coordinates of player if block behind {_b} is air: if block 1 meter south of {_b} is air: if block 1 meter west of {_b} is air: if block 1 meter east of {_b} is air: if block 1 meter north of {_b} is air: wait 10 ticks set {_x2} to x-coordinates of player set {_z2} to z-coordinates of player set {_y2} to y-coordinates of player if {_x2} is higher than or equal to {_x1}: if difference between {_x2} and {_x1} is higher than 2.1: set {_p} to player's ping set {_block} to block under player wf "LOG (FLIGHT X): ALTITUDE: %player's altitude%, PINGS: %player's ping% TIME: %now%" to {@logdir} loop all players: if loop-player has permission "potpvp.staff": wait 1 second message "%{prefix}% &e&l%player% &c(Flight-X) (Ping: %player's ping%) **EXPERIMENTAL" to loop-player if {potpvp.debug} is true: message "&6&m-----------------------------------" to loop-player message "&fPing: &7%player's ping%" to loop-player message "&fSpeed: &7%player's altitude%" to loop-player message "&6&m-----------------------------------" to loop-player if {_z2} is higher than or equal to {_z1}: if difference between {_z2} and {_z1} is higher than 2.1: set {_p} to player's ping set {_block} to block under player wf "LOG (FLIGHT Z): ALTITUDE: %player's altitude%, PINGS: %player's ping% TIME: %now%" to {@logdir} loop all players: wait 1 second if loop-player has permission "potpvp.staff": message "%{prefix}% &e&l%player% &c(Flight-Z) (Ping: %player's ping%) **EXPERIMENTAL" to loop-player if {potpvp.debug} is true: message "&6&m-----------------------------------" to loop-player message "&fPing: &7%player's ping%" to loop-player message "&fSpeed: &7%player's altitude%" to loop-player message "&6&m-----------------------------------" to loop-player if {_y2} is higher than or equal to {_y1}: if difference between {_y2} and {_y1} is higher than 2.1: push player downwards at speed 1.2 set {_p} to player's ping set {_block} to block under player wf "LOG (FLIGHT Y): ALTITUDE: %player's altitude% PINGS: %player's ping% TIME: %now%" to {@logdir} loop all players: wait 10 ticks if loop-player has permission "potpvp.staff": message "%{prefix}% &e&l%player% &c(Flight-Y) (Ping: %player's ping%)" to loop-player if {potpvp.debug} is true: message "&6&m-----------------------------------" to loop-player message "&fPing: &7%player's ping%" to loop-player message "&fSpeed: &7%player's altitude%" to loop-player message "&6&m-----------------------------------" to loop-player on damage: attacker is player victim is player attacker doesn't have permission "potpvp.bypass" victim doesn't have permission "potpvp.bypass" set {fac.%attacker%} to attacker's facing wait 1 tick set {fac1.%attacker%} to attacker's facing if {fac.%attacker%} is not {fac1.%attacker%}: loop all players: if loop-player has permission "potpvp.staff": message "%{prefix}% &e&l%attacker% &c(KillAura-FHM) (Ping: %attacker's ping%) (1-Tick: %{fac.%attacker%}% vs. 2-Tick: %{fac1.%attacker%}%) **EXPERIMENTAL" to loop-player on chat: if player doesn't have permission "potpvp.bypass": if player is sneaking: loop all players: if loop-player has permission "potpvp.staff": message "%{prefix}% &e&l%player% &c(Sneak) (Ping: %player's ping%)" to loop-player on sign change: if player doesn't have permission "potpvp.bypass": if player is sneaking: loop all players: if loop-player has permission "potpvp.staff": message "%{prefix}% &e&l%player% &c(Sneak) (Ping: %player's ping%)" to loop-player on any movement: if player doesn't have permission "potpvp.bypass": if player is sneaking: if player is sprinting: loop all players: if loop-player has permission "potpvp.staff": message "%{prefix}% &e&l%player% &c(Sneak) (Ping: %player's ping%)" to loop-player on damage of player: if damage cause is fall: stop else: if victim doesn't have permission "potpvp.bypass": if attacker is a player: if block at victim is not cobweb: if victim's gamemode is not creative: set {_loc} to location of victim wait 10 ticks if distance between {_loc} and victim = 0: if victim's ping is less than 251: set {_ub} to block above victim if block above {_ub} is air: set {_b} to block above {_ub} if block behind {_b} is air: if block 1 meter south of {_b} is air: if block 1 meter west of {_b} is air: if block 1 meter east of {_b} is air: if block 1 meter north of {_b} is air: loop all players: if loop-player has permission "potpvp.staff": message "%{prefix}% &e&l%victim% &c(AntiKB) (Ping: %victim's ping%)" to loop-player on shoot: if projectile is an arrow: set {bow.%shooter%} to true wait 7 ticks delete {bow.%shooter%} on shoot: projectile is arrow if {bow.%shooter%} is set: set {bow1.%shooter%} to true loop all players: if {bow1.%shooter%} is set: cancel event delete {bow1.%shooter%} if loop-player has permission "potpvp.staff": message "%{prefix}% &e&l%shooter% &c(FastBow) (Ping: %shooter's ping%)" to loop-player command /ping: trigger: message "&c&l%player's ping%" command /follow []: permission: potpvp.staff permission message: &cNo permission. trigger: if {spec.%player%} is not set: if arg 1 is set: if {follow.%player%} is not set: set {follow.%player%} to arg 1 hide player from all players set player's flight mode to true make player execute command "/moditems" else: delete {follow.%player%} reveal player to all players if "%player's gamemode%" is not "creative": set player's flight mode to false else: send "&cYou must first disable &4/staffspec &cto follow someone!" every 0.1 second: loop all players: if {follow.%loop-player%} is set: set {2m.%loop-player%} to location 5 meter behind {follow.%loop-player%} set {2h.%loop-player%} to location 1 meter above {2m.%loop-player%} teleport loop-player to {2h.%loop-player%} if {spec.%loop-player%} is set: teleport loop-player 0.07 meter in front of {spec.%loop-player%} on pickup: if {follow.%player%} is set: cancel event if {spec.%player%} is set: cancel event on damage: if {follow.%attacker%} is set: cancel event if {follow.%victim%} is set: cancel event if {spec.%attacker%} is set: cancel event if {spec.%victim%} is set: cancel event command /staffspec []: permission: potpvp.staff permission message: &cNo permission. trigger: if {follow.%player%} is set: stop send "&cYou must first disable &4/follow &cto spectate someone!" else: if arg 1 is set: make player execute command "/moditems" set {spec.%player%} to arg 1 hide player from all players set player's flight mode to true hide {spec.%player%} from player else: reveal {spec.%player%} to player delete {spec.%player%} reveal player to all players teleport player 1 meter above player if "%player's gamemode%" is not "creative": set player's flight mode to false on rightclick: if player's held item is 351:10 named "&aVanish" with lore "&7Use this to toggle your vanish!": if player has permission "potpvp.staff": message "&a»&e Toggling your vanish to &cOFF&e..." execute player command "evanish" remove 1 351:10 named "&aVanish" with lore "&7Use this to toggle your vanish!" from player set slot 2 of player to gray dye named "&cVanish" with lore "&7Use this to toggle your vanish!" stop if player's held item is gray dye named "&cVanish" with lore "&7Use this to toggle your vanish!": if player has permission "potpvp.staff": message "&a»&e Toggling your vanish to &aON&e..." execute player command "evanish" remove 1 gray dye named "&cVanish" with lore "&7Use this to toggle your vanish!" from player set slot 2 of player to 351:10 named "&aVanish" with lore "&7Use this to toggle your vanish!" stop if player's held item is 347 named "&6Random Follow" with lore "&7Use this to randomly follow to someone!": if player has permission "potpvp.staff": set {random.%Player%} to a random player out of all players while {random.%player%} is player: set {random.%Player%} to a random player out of all players make player execute command "/follow" make player execute command "/follow %{random.%Player%}%" message "&a»&e You have been teleported to &6%{Random.%player%}%&e!" stop on command "evanish": player has permission "potpvp.staff" cancel event if player has 1 gray dye named "&cVanish" with lore "&7Use this to toggle your vanish!": remove 1 gray dye named "&cVanish" with lore "&7Use this to toggle your vanish!" from player set slot 0 of player to 351:10 named "&aVanish" with lore "&7Use this to toggle your vanish!" reveal player to all players stop if player has 1 351:10 named "&aVanish" with lore "&7Use this to toggle your vanish!": remove 1 gray dye named "&aVanish" with lore "&7Use this to toggle your vanish!" from player set slot 0 of player to gray dye named "&cVanish" with lore "&7Use this to toggle your vanish!" hide player from all players stop command /moditems: permission: potpvp.staff permission message: &cNo permission. trigger: if {follow.%player%} is set: if {mod.%player%} is not set: set {mod.%player%} to true set slot 0 of player to 351:10 named "&aVanish" with lore "&7Use this to toggle your vanish!" set slot 1 of player to 347 named "&6Random Follow" with lore "&7Use this to randomly follow to someone!"