Skip to content

Commit

Permalink
v1.9
Browse files Browse the repository at this point in the history
  • Loading branch information
BlaizerBrumo committed Apr 20, 2024
1 parent 0fd6306 commit 65dd91c
Show file tree
Hide file tree
Showing 66 changed files with 717 additions and 215 deletions.
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ For any questions or help please join the official SafeGuard discord server: [di
> _If player matches any of these checks, player is warned and is given weakness for 2s to prevent giving attacks_
> - **High CPS Check:** Checks if a player has a cps higher than the set amount inside of [config]
> - **Multi Killaura Check:** Checks if a player attacks more entities then the set amount inside [config]
> - **Combat Log Detection:** Checks if a player rejoins the server after leaving during combat and gives them the punishment selected in [config]
>
>
> ### 🏷️ Item Cheat Detections
Expand All @@ -29,11 +30,13 @@ For any questions or help please join the official SafeGuard discord server: [di
> ### 🏃 Movement Cheat Detections
> _If player matches any of these checks, player is warned and the anticheat tries to fix their position by teleporting_
> - **Fly Check:** Checks if player is flying
> - **Invalid Velocity Check:** Checks if player is reaching an invalid Y velocity
>
>
> ### 🌎 World Cheat Detections
> _If player matches any of these checks, player is warned and anticheat replaces any broken blocks_
> - **Nuker Check:** Checks if player breaks more blocks than the set amount inside [config]
> - **Scaffold Check:** Checks if player is using scaffold or tower modules for horion
> - **Illegal Item Place Check:** Checks if player places a block or uses an item that is inside the banned item list in [config]
>
>
Expand Down Expand Up @@ -78,20 +81,22 @@ For any questions or help please join the official SafeGuard discord server: [di
> - **invsee [player name]:** See the inventory of a player
> - **mute [player name]:** Mute a player
> - **unmute [player name]:** Unmute a player
> - **worldborder [border]:** Get or set the world border
> - **worldborder [border | remove]:** Get or set the world border
> - **vanish:** Toggle vanish mode
> - **clearchat:** Clear the chat
> - **fakeleave:** Simulate leaving the realm
> - **fakeleave_server:** Simulate leaving the server
> - **summon_npc:** Summon an NPC
> - **notify:** Toggle anticheat notifications
> - **lagclear:** Run lag clear function
> - **copyinv [player name]:** Copy the inventory of a player
> - **unban [player name]:** Unban a player
> - **report [player name]:** Players can report other player anonymously to all online admins
>
>
> ### 📃 Admin Panel Item
> _The admin panel is an item which can be obtained with command `/give @s safeguard:admin_panel`_
> - **Settings:** Turn SafeGuard module/feature settings
> - **Settings:** Toggle SafeGuard modules/features
> - **Quick Ban:** Quickly ban a player using SafeGuard ban system
> - **Player Actions:** Select an online player to ban, clear echest, warn, etc
> - **Unban Player:** Enter a player's name to unban, they will be unban when they rejoin
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#bridge-file-version: #12
execute as @s[tag=admin] run tellraw @a {"rawtext":[{"text":"\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n§6[§eSafeGuard§6]§r Chat has been cleared by §d"},{"selector":"@s"}]}
execute as @s[tag=!admin] run tellraw @s {"rawtext":[{"text":"§6[§eSafeGuard§6]§4 You need admin tag to run this!§r"}]}
playsound random.anvil_land @s[tag=!admin]
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#bridge-file-version: #11
execute as @s[tag=admin] run tellraw @a {"rawtext":[{"text":"§e"},{"selector":"@s"},{"text":" left the realm"}]}
tellraw @s {"rawtext":[{"text":"§6[§eSafeGuard§6]§a Fake left success!"}]}
playsound random.levelup @s[tag=admin]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
#bridge-file-version: #1
execute as @s[tag=admin] run tellraw @a {"rawtext":[{"text":"§e"},{"selector":"@s"},{"text":" left the server"}]}
tellraw @s {"rawtext":[{"text":"§6[§eSafeGuard§6]§a Fake left success!"}]}
playsound random.levelup @s[tag=admin]
tellraw @s[tag=!admin] {"rawtext":[{"text":"§6[§eSafeGuard§6]§r §4You need admin tag to run this!"}]}
playsound random.anvil_land @s[tag=!admin]
execute as @s[tag=admin] run tellraw @a {"rawtext":[{"text":"§e"},{"selector":"@s"},{"text":" left the server"}]}
tellraw @s {"rawtext":[{"text":"§6[§eSafeGuard§6]§a Fake left success!"}]}
playsound random.levelup @s[tag=admin]
tellraw @s[tag=!admin] {"rawtext":[{"text":"§6[§eSafeGuard§6]§r §4You need admin tag to run this!"}]}
playsound random.anvil_land @s[tag=!admin]
#notify
tellraw @a[tag=admin,scores={notify=1}] {"rawtext":[{"text":"§6[§eSafeGuard Notify§6]§5§l "},{"selector":"@s"},{"text":" §bfake left!§r"}]}
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#bridge-file-version: #6
scoreboard players add @s notify 1
scoreboard players set @s[tag=admin,scores={notify=2..}] notify 0
tellraw @s[tag=admin,scores={notify=0}] {"rawtext":[{"text":"§6[§eSafeGuard§6]§r§l§b You will §5no longer§b recieve anticheat notifications!§r"}]}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#bridge-file-version: #7
execute as @s[tag=admin] run summon npc ~ ~ ~
tag @e[type=npc,r=5] add friend
tellraw @s[tag=admin] {"rawtext":[{"text":"§6[§eSafeGuard§6]§r §aSuccessfully summoned the NPC!§r"}]}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#bridge-file-version: #25
scoreboard players add @s[tag=admin] vanish 1
scoreboard players set @s[tag=admin,scores={vanish=2..}] vanish 0
effect @s[tag=admin,scores={vanish=0}] invisibility 0 0
Expand Down
25 changes: 12 additions & 13 deletions Safeguard anti-cheat B/functions/anti/anti_grief.mcfunction
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
#bridge-file-version: #35
tellraw @s {"rawtext":[{"text":"§6[§eSafeGuard§6]§r§c§l "},{"text":"ERROR: §r§4This function shouldn't be ran manually§r"}]}
tellraw @s {"rawtext":[{"text":"§6[§eSafeGuard§6]§r§c§l "},{"text":"ERROR: §r§4This function shouldn't be ran manually§r"}]}
#gamerule
execute as @a[scores={grief_on=0}] run gamerule tntexplodes false
execute as @a[scores={grief_on=0}] run gamerule respawnblocksexplode false
execute as @a[scores={grief_on=0}] run gamerule tntexplodes false
execute as @a[scores={grief_on=0}] run gamerule respawnblocksexplode false
#detect
execute as @a[scores={grief_on=0}] run execute as @e[type=tnt,tag=!admin] run tellraw @a {"rawtext":[{"text":"§6[§eSafeGuard§6]§r§c§l "},{"selector":"@p[tag=!admin]"},{"text":" §r§4Was detected summoning a §l§cTNT!§r"}]}
execute as @a[scores={grief_on=0}] run execute as @e[type=tnt,tag=!admin] run execute as @p run function punishment/warning/grief_warning
execute as @a[scores={grief_on=0}] run execute as @e[type=tnt,tag=!admin] run tellraw @a {"rawtext":[{"text":"§6[§eSafeGuard§6]§r§c§l "},{"selector":"@p[tag=!admin]"},{"text":" §r§4Was detected summoning a §l§cTNT!§r"}]}
execute as @a[scores={grief_on=0}] run execute as @e[type=tnt,tag=!admin] run execute as @p run function punishment/warning/grief_warning
#clear inventory
execute as @a[scores={grief_on=0}] run clear @a[tag=!admin] tnt 0
execute as @a[scores={grief_on=0}] run clear @a[tag=!admin] tnt_minecart 0
execute as @a[scores={grief_on=0}] run clear @a[tag=!admin] end_crystal 0
execute as @a[scores={grief_on=0}] run clear @a[tag=!admin] respawn_anchor 0
execute as @a[scores={grief_on=0}] run clear @a[tag=!admin] tnt 0
execute as @a[scores={grief_on=0}] run clear @a[tag=!admin] tnt_minecart 0
execute as @a[scores={grief_on=0}] run clear @a[tag=!admin] end_crystal 0
execute as @a[scores={grief_on=0}] run clear @a[tag=!admin] respawn_anchor 0
#Kill tnt
execute as @a[scores={grief_on=0}] run execute as @a run kill @e[type=tnt]
execute as @a[scores={grief_on=0}] run execute as @a run kill @e[type=tnt_minecart]
execute as @a[scores={grief_on=0}] run execute as @a run kill @e[type=tnt]
execute as @a[scores={grief_on=0}] run execute as @a run kill @e[type=tnt_minecart]
#Replace tnt and other explosive blocks as a security measure
execute as @a[scores={grief_on=0}] run execute as @a[tag=!admin] run fill ~8 ~5 ~8 ~-8 ~-5 ~-8 air 0 replace tnt
execute as @a[scores={grief_on=0}] run execute as @a[tag=!admin] run fill ~8 ~5 ~8 ~-8 ~-5 ~-8 air 0 replace tnt
execute as @a[scores={grief_on=0}] run execute as @a[tag=!admin] run fill ~8 ~5 ~8 ~-8 ~-5 ~-8 air 0 replace fire
7 changes: 3 additions & 4 deletions Safeguard anti-cheat B/functions/anti/anti_lag.mcfunction
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#bridge-file-version: #37
#PUT THIS IN A REPEATING COMMAND BLOCK ONLY WITH A TICK PER SECOND DELAY
#Killing the entities and stuff idk
gamerule domobloot false
scoreboard objectives add anti_lag dummy
scoreboard players add @r anti_lag 1
gamerule domobloot false
scoreboard objectives add anti_lag dummy
scoreboard players add @r anti_lag 1
execute as @a[scores={anti_lag=1}] run tellraw @a[scores={anti_lag=1}] {"rawtext":[{"text":"§6[§eSafeGuard§6]§r§l§a Ground items cleared in 10 seconds..."}]}
2 changes: 1 addition & 1 deletion Safeguard anti-cheat B/functions/assets/asset.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ scoreboard players reset @a[scores={warn_check=6001..}] warn_check
tag @a[tag=warn_check] remove warn_check
#warning check2
execute as @a[tag=warn_fast] run tellraw @a {"rawtext":[{"text":"§6[§eSafeGuard§6]§r§l§c "},{"selector": "@s"},{"text":" §4is reaching warnings too fast and was softbanned!§r"}]}
execute as @a[tag=warn_fast] run tag @s add softban_five
execute as @a[tag=warn_fast] run tag @s add safeguard:reachingWarningsTooFast
execute as @a[tag=warn_fast] run tag @s add warning
execute as @a[tag=warn_fast] run scoreboard players reset @s warn_check
execute as @a[tag=warn_fast] run tag @s remove warn_fast
Expand Down
1 change: 0 additions & 1 deletion Safeguard anti-cheat B/functions/assets/boom.mcfunction
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
#bridge-file-version: #1
particle minecraft:huge_explosion_emitter ~~~
playsound mob.wither.break_block
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#bridge-file-version: #25
gamerule mobgriefing false
execute as @s[scores={death_effect=0}] run summon minecraft:lightning_bolt ~ ~3~
execute as @s[scores={death_effect=0}] run playsound random.levelup @s
Expand Down
1 change: 0 additions & 1 deletion Safeguard anti-cheat B/functions/assets/default.mcfunction
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#bridge-file-version: #29
#These are punishments and similar
tellraw @s {"rawtext":[{"text":"§6[§eSafeGuard§6]§r§c§l "},{"text":"ERROR: §r§4This function shouldn't be ran manually§r"}]}
function assets/welcomer
Expand Down
13 changes: 6 additions & 7 deletions Safeguard anti-cheat B/functions/assets/welcomer.mcfunction
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
#bridge-file-version: #27
#Tag
tellraw @s {"rawtext":[{"text":"§6[§eSafeGuard§6]§r§c§l "},{"text":"ERROR: §r§4This function shouldn't be ran manually§r"}]}
execute as @a[scores={welcome_on=0}] run scoreboard players set @a[scores={welcomer=3..}] welcomer 2
execute as @a[scores={welcome_on=0}] run execute as @a[scores={welcomer=..1}] run tellraw @a {"rawtext":[{"text":"§e"},{"selector":"@s"},{"text":" §bIs joining for the first time! This realm is protected by §eSafeGuard§b, enjoy your stay!§r"}]}
execute as @a[scores={welcome_on=0}] run scoreboard players add @a welcomer 1
execute as @a[scores={welcome_on=0}] run title @a[scores={welcomer=..1}] title §e§lSafe§6Guard
execute as @a[scores={welcome_on=0}] run title @a[scores={welcomer=..1}] subtitle §l§fProtecting §a24§f/§a7
tellraw @s {"rawtext":[{"text":"§6[§eSafeGuard§6]§r§c§l "},{"text":"ERROR: §r§4This function shouldn't be ran manually§r"}]}
execute as @a[scores={welcome_on=0}] run scoreboard players set @a[scores={welcomer=3..}] welcomer 2
execute as @a[scores={welcome_on=0}] run execute as @a[scores={welcomer=..1}] run tellraw @a {"rawtext":[{"text":"§e"},{"selector":"@s"},{"text":" §bIs joining for the first time! This realm is protected by §eSafeGuard§b, enjoy your stay!§r"}]}
execute as @a[scores={welcome_on=0}] run scoreboard players add @a welcomer 1
execute as @a[scores={welcome_on=0}] run title @a[scores={welcomer=..1}] title §e§lSafe§6Guard
execute as @a[scores={welcome_on=0}] run title @a[scores={welcomer=..1}] subtitle §l§fProtecting §a24§f/§a7
execute as @a[scores={welcome_on=0}] run title @a[scores={welcomer=..1}] times 20 80 20
2 changes: 2 additions & 0 deletions Safeguard anti-cheat B/functions/check_settings.mcfunction
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
tellraw @s {"rawtext":[{"text":"§6[§eSafeGuard§6]§r§6§l "},{"text":"WARNING: §r§4This function is deprecated and is no longer updated, expect broken behavior and outdated information§r"}]}

#deny
tellraw @s[tag=!admin] {"rawtext":[{"text":"§6[§eSafeGuard§6]§r §4You need admin tag to run this!§r"}]}
playsound random.anvil_land @s[tag=!admin]
Expand Down
2 changes: 1 addition & 1 deletion Safeguard anti-cheat B/functions/credit.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ tellraw @s {"rawtext":[{"text":"\n"}]}
tellraw @s {"rawtext":[{"text":"§l§e Help"}]}
tellraw @s {"rawtext":[{"text":"§l§6----------------------------------------------------------§r"}]}
tellraw @s {"rawtext":[{"text":"Blazer#9677 - Join the disord for any help nGu5gehXs3"}]}
tellraw @s {"rawtext":[{"text":"Version 1.8.4"}]}
tellraw @s {"rawtext":[{"text":"Version 1.9"}]}
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#bridge-file-version: #28
tellraw @s {"rawtext":[{"text":"§6[§eSafeGuard§6]§r§c§l "},{"text":"ERROR: §r§4This function shouldn't be ran manually§r"}]}
tag @a[tag=ban,tag=!admin] add Ban
scoreboard players add @a[tag=ac_ban,tag=!admin] ac_banned 1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#bridge-file-version: #3
tellraw @s {"rawtext":[{"text":"§6[§eSafeGuard§6]§r§c§l "},{"text":"ERROR: §r§4This function shouldn't be ran manually§r"}]}
title @a[tag=echest_ban] times 1 1 1
title @a[tag=echest_ban] actionbar §l§4You are echest banned.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#bridge-file-version: #10
tellraw @s {"rawtext":[{"text":"§6[§eSafeGuard§6]§r§c§l "},{"text":"ERROR: §r§4This function shouldn't be ran manually§r"}]}
tellraw @a[tag=echest_unban] {"rawtext":[{"text":"§6[§eSafeGuard§6] §aEchest ban was removed!!"}]}
execute as @a[tag=echest_unban] run tellraw @a[tag=admin,scores={notify=1}] {"rawtext":[{"text":"§6[§eSafeGuard Notify§6]§5§l "},{"selector":"@a[tag=echest_unban]"},{"text":"'s §benderchest ban was removed! §r"}]}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#bridge-file-version: #14
tellraw @s {"rawtext":[{"text":"§6[§eSafeGuard§6]§r§c§l "},{"text":"ERROR: §r§4This function shouldn't be ran manually§r"}]}
replaceitem entity @a[tag=!admin,tag=echest_wipe] slot.enderchest 0 air
replaceitem entity @a[tag=!admin,tag=echest_wipe] slot.enderchest 1 air
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#bridge-file-version: #18
title @a[tag=flagged] times 1 1 1
gamemode adventure @a[tag=flagged]
effect @a[tag=flagged] slowness 1000 10 true
inputpermission set @a[tag=flagged] movement disabled
inputpermission set @a[tag=flagged] camera disabled
effect @a[tag=flagged] blindness 1000 10 true
title @a[tag=flagged] title §4You have been flagged!§r
title @a[tag=flagged] subtitle §4Contact your admin for appeal.§r
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#bridge-file-version: #17
tellraw @s {"rawtext":[{"text":"§6[§eSafeGuard§6]§r§c§l "},{"text":"ERROR: §r§4This function shouldn't be ran manually§r"}]}
tag @a[tag=unflag] remove flagged
gamemode survival @a[tag=unflag]
effect @a[tag=unflag] clear
inputpermission set @a[tag=unflag] movement enabled
inputpermission set @a[tag=unflag] camera enabled
tellraw @a[tag=unflag] {"rawtext":[{"text":"§6[§eSafeGuard§6] §aFlag was removed!!"}]}
execute as @a[tag=unflag] run tp @p[tag=unflag] ~ 140 ~
effect @a[tag=unflag] slow_falling 60 0 true
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#bridge-file-version: #10
tellraw @s {"rawtext":[{"text":"§6[§eSafeGuard§6]§r§c§l "},{"text":"ERROR: §r§4This function shouldn't be ran manually§r"}]}
title @a[tag=freeze] times 1 1 1
execute at @a[tag=freeze] run tp @s[tag=freeze] ~ ~ ~ facing @s
effect @a[tag=freeze] slowness 100 100 true
inputpermission set @a[tag=freeze] movement disabled
title @a[tag=freeze] actionbar §b§lYou are frozen.§r
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
#bridge-file-version: #13
#unfreezes person
tellraw @s {"rawtext":[{"text":"§6[§eSafeGuard§6]§r§c§l "},{"text":"ERROR: §r§4This function shouldn't be ran manually§r"}]}
tag @a[tag=unfreeze] remove freeze
effect @a[tag=unfreeze] clear
inputpermission set @a[tag=unfreeze] movement enabled
tellraw @a[tag=unfreeze] {"rawtext":[{"text":"§6[§eSafeGuard§6] §aFreeze was removed!!"}]}
execute as @a[tag=unfreeze] run tellraw @a[tag=admin,scores={notify=1}] {"rawtext":[{"text":"§6[§eSafeGuard Notify§6]§5§l "},{"selector":"@a[tag=unfreeze]"},{"text":" §bwas unfreezed! §r"}]}
tag @a[tag=unfreeze] remove unfreeze
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#bridge-file-version: #7
tellraw @s {"rawtext":[{"text":"§6[§eSafeGuard§6]§r§c§l "},{"text":"ERROR: §r§4This function shouldn't be ran manually§r"}]}
#This will clear victim's inventory and not let them use it.
clear @a[tag=inv_lock]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#bridge-file-version: #7
tellraw @a[tag=inv_unlock] {"rawtext":[{"text":"§6[§eSafeGuard§6] §aInventory lock was removed!!"}]}
clear @a[tag=inv_unlock]
execute as @a[tag=inv_unlock] run tellraw @a[tag=admin,scores={notify=1}] {"rawtext":[{"text":"§6[§eSafeGuard Notify§6]§5§l "},{"selector":"@a[tag=inv_unlock]"},{"text":"'s §binventory was unlocked! §r"}]}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#bridge-file-version: #22
execute as @a[scores={warning=3..},tag=!admin] run tag @s add ac_ban
#Warning
execute as @a[tag=warning,tag=!admin] run scoreboard players add @s warning 1
Expand Down
2 changes: 0 additions & 2 deletions Safeguard anti-cheat B/functions/settings/anti_gmc.mcfunction
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#bridge-file-version: #0
#0
#Toggle the Anti GMC
scoreboard players add @s[tag=admin] gmc_toggle 1
scoreboard players set @s[tag=admin,scores={gmc_toggle=2..}] gmc_toggle 0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#bridge-file-version: #0
#2
#Toggle the Anti grief
scoreboard players add @s[tag=admin] grief_toggle 1
scoreboard players set @s[tag=admin,scores={grief_toggle=2..}] grief_toggle 0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#bridge-file-version: #0
#0
#Toggle the Anti item
scoreboard players add @s[tag=admin] item_toggle 1
scoreboard players set @s[tag=admin,scores={item_toggle=2..}] item_toggle 0
Expand Down
2 changes: 0 additions & 2 deletions Safeguard anti-cheat B/functions/settings/auto_mod.mcfunction
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#bridge-file-version: #0
#19
#Toggle the auto mod
scoreboard players add @s[tag=admin] auto_mod_toggle 1
scoreboard players set @s[tag=admin,scores={auto_mod_toggle=2..}] auto_mod_toggle 0
Expand Down
14 changes: 14 additions & 0 deletions Safeguard anti-cheat B/functions/settings/beta/anti_fly.mcfunction
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#Toggle fly protection
scoreboard players add @s[tag=admin] antifly_toggle 1
scoreboard players set @s[tag=admin,scores={antifly_toggle=2..}] antifly_toggle 0
tellraw @s[tag=admin,scores={antifly_toggle=0}] {"rawtext":[{"text":"§6[§eSafeGuard§6]§b Anti Fly §l§5turned off! §r"}]}
execute as @s[tag=admin,scores={antifly_toggle=0}] run scoreboard objectives remove "safeguard:fly_check"
tellraw @s[tag=admin,scores={antifly_toggle=1}] {"rawtext":[{"text":"§6[§eSafeGuard§6]§b Anti Fly §l§5turned on! §r"}]}
execute as @s[tag=admin,scores={antifly_toggle=1}] run scoreboard objectives add "safeguard:fly_check" dummy
playsound note.bass @s[tag=admin] ~~~
#deny
tellraw @s[tag=!admin] {"rawtext":[{"text":"§6[§eSafeGuard§6]§r §4You need admin tag to run this!§r"}]}
playsound random.anvil_land @s[tag=!admin]
#Notify people who turned it on
execute as @s[scores={antifly_toggle=1}] run tellraw @a[tag=admin,scores={notify=1}] {"rawtext":[{"text":"§6[§eSafeGuard Notify§6]§5§l "},{"selector":"@s[scores={antifly_toggle=1}]"},{"text":" §bturned on§l§5 Anti Fly! §r"}]}
execute as @s[scores={antifly_toggle=0}] run tellraw @a[tag=admin,scores={notify=1}] {"rawtext":[{"text":"§6[§eSafeGuard Notify§6]§5§l "},{"selector":"@s[scores={antifly_toggle=0}]"},{"text":" §bturned off§l§5 Anti Fly! §r"}]}
Loading

0 comments on commit 65dd91c

Please sign in to comment.